From owner-svn-ports-head@freebsd.org Sat Sep 19 22:04:33 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77D873F0868; Sat, 19 Sep 2020 22:04:33 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bv4Vn2XKSz4Ylw; Sat, 19 Sep 2020 22:04:33 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A36413200; Sat, 19 Sep 2020 22:04:33 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JM4Xxi030342; Sat, 19 Sep 2020 22:04:33 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JM4WMg030340; Sat, 19 Sep 2020 22:04:32 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <202009192204.08JM4WMg030340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Sat, 19 Sep 2020 22:04:32 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r549074 - in head/benchmarks/linux-gputest: . files X-SVN-Group: ports-head X-SVN-Commit-Author: danfe X-SVN-Commit-Paths: in head/benchmarks/linux-gputest: . files X-SVN-Commit-Revision: 549074 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 22:04:33 -0000 Author: danfe Date: Sat Sep 19 22:04:32 2020 New Revision: 549074 URL: https://svnweb.freebsd.org/changeset/ports/549074 Log: To support optional FreeBSD branding in the future, switch to binary patch instead of sed(1) when adjusting log file location. No functional changes. Added: head/benchmarks/linux-gputest/files/apply-binary-patch.pl (contents, props changed) head/benchmarks/linux-gputest/files/fix-logfile-path.crk (contents, props changed) Modified: head/benchmarks/linux-gputest/Makefile Modified: head/benchmarks/linux-gputest/Makefile ============================================================================== --- head/benchmarks/linux-gputest/Makefile Sat Sep 19 22:00:43 2020 (r549073) +++ head/benchmarks/linux-gputest/Makefile Sat Sep 19 22:04:32 2020 (r549074) @@ -21,8 +21,11 @@ LICENSE_PERMS= dist-mirror pkg-mirror auto-accept ONLY_FOR_ARCHS= amd64 -USES= linux zip +PATCH_DEPENDS= p5-Sys-Mmap>0:devel/p5-Sys-Mmap + +USES= linux perl5 zip USE_LINUX= dri libglvnd xorglibs +USE_PERL5= patch NO_BUILD= yes OPTIONS_DEFINE= DOCS GUI @@ -36,10 +39,8 @@ GUI_USES= python:run post-patch: @${REINPLACE_CMD} -e '1s,bash,sh,' ${WRKSRC}/start_*.sh @${RM} ${WRKSRC}/data/.DS_Store -# Save log file in writable location instead of ${PREFIX}/lib/${PORTNAME} - @${REINPLACE_CMD} -e \ - 's,_geeks3d_gputest_log\.txt,/tmp/geeks3d_gputest.log,' \ - ${WRKSRC}/GpuTest + @cd ${WRKSRC} && ${PERL} ${FILESDIR}/apply-binary-patch.pl < \ + ${FILESDIR}/fix-logfile-path.crk # We cannot just embed shebang line in the patch because 210:fix-shebang # happens before 500:do-patch :( Added: head/benchmarks/linux-gputest/files/apply-binary-patch.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/benchmarks/linux-gputest/files/apply-binary-patch.pl Sat Sep 19 22:04:32 2020 (r549074) @@ -0,0 +1,33 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Sys::Mmap; + +my $fh; +my $flen; +my $fdata; + +sub commit { + return unless $fh; + munmap $fdata or die "munmap: $!"; + close $fh or die "close: $!"; +} + +while (<>) { + chomp; + if (/^([0-9A-F]{8}):? ([0-9A-F]{2}) ([0-9A-F]{2})$/i) { + my ($offset, $old, $new) = map hex, $1, $2, $3; + next unless $fdata; + next unless $offset < $flen; + next if ord substr($fdata, $offset, 1) != $old; + substr($fdata, $offset, 1) = chr $new; + } elsif (-e) { + commit; + open $fh, '+<', $_ or die "open: $!"; + mmap $fdata, 0, PROT_READ | PROT_WRITE, MAP_SHARED, $fh + or die "mmap: $!"; + $flen = -s; + } +} +commit; Added: head/benchmarks/linux-gputest/files/fix-logfile-path.crk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/benchmarks/linux-gputest/files/fix-logfile-path.crk Sat Sep 19 22:04:32 2020 (r549074) @@ -0,0 +1,95 @@ +; GpuTest is not cwd-agnostic and must be run in ${PREFIX}/lib/${PORTNAME} +; where it looks for resources and writes its logfile. Change the logfile +; location to user-writable directory (/tmp) and shift a couple of strings +; to make the room for other changes. + +GpuTest + +00036FE0: 5F 2F +00036FE1: 67 74 +00036FE2: 65 6D +00036FE3: 65 70 +00036FE4: 6B 2F +00036FE5: 73 5F +00036FE6: 33 67 +00036FE7: 64 65 +00036FE8: 5F 65 +00036FE9: 67 6B +00036FEA: 70 73 +00036FEB: 75 33 +00036FEC: 74 64 +00036FED: 65 5F +00036FEE: 73 67 +00036FEF: 74 70 +00036FF0: 5F 75 +00036FF1: 6C 74 +00036FF2: 6F 65 +00036FF3: 67 73 +00036FF4: 2E 74 +00036FF5: 74 2E +00036FF6: 78 6C +00036FF7: 74 6F +00036FF8: 00 67 + +; "Linux x%d" moves +1 byte (1 reference) +; 424bbb: be f9 6f 43 00 mov $0x436ff9,%esi +00024BBC: F9 FA + +00036FF9: 4C 00 +00036FFA: 69 4C +00036FFB: 6E 69 +00036FFC: 75 6E +00036FFD: 78 75 +00036FFE: 20 78 +00036FFF: 78 20 +00037000: 25 78 +00037001: 64 25 +00037002: 00 64 + +; "GpuTest" moves +3 bytes (3 references) +; 424c4b: be 03 70 43 00 mov $0x437003,%esi +; 424dba: b9 03 70 43 00 mov $0x437003,%ecx +; 425040: ba 03 70 43 00 mov $0x437003,%edx +00024C4C: 03 06 +00024DBB: 03 06 +00025041: 03 06 + +00037003: 47 00 +00037004: 70 00 +00037005: 75 00 +00037006: 54 47 +00037007: 65 70 +00037008: 73 75 +00037009: 74 54 +0003700A: 00 65 + +; "%s (%s) is starting up..." moves +3 bytes (1 reference) +; 424d9c: ba 0b 70 43 00 mov $0x43700b,%edx +00024D9D: 0B 0E + +0003700B: 25 73 +0003700C: 73 74 +0003700D: 20 00 +0003700E: 28 25 +0003700F: 25 73 +00037010: 73 20 +00037011: 29 28 +00037012: 20 25 +00037013: 69 73 +00037014: 73 29 +00037016: 73 69 +00037017: 74 73 +00037018: 61 20 +00037019: 72 73 +0003701B: 69 61 +0003701C: 6E 72 +0003701D: 67 74 +0003701E: 20 69 +0003701F: 75 6E +00037020: 70 67 +00037021: 2E 20 +00037022: 2E 75 +00037023: 2E 70 +00037024: 00 2E +00037025: 00 2E +00037026: 00 2E