Merge pull request #294708 from TomaSajt/mkgmap

mkgmap{,-splitter}: make deterministic add missing phase hook calls

authored by Nikolay Korotkiy and committed by GitHub c2e4139f ba6a8872

+102 -68
+1 -18
pkgs/applications/misc/mkgmap/build.xml.patch
··· 1 --- a/build.xml (revision 4555) 2 +++ a/build.xml (working copy) 3 - @@ -222,13 +222,13 @@ 4 - <property name="svn.version.build" value="none"/> 5 - 6 - <propertyfile file="${build.classes}/mkgmap-version.properties"> 7 - - <entry key="svn.version" value="${svn.version.build}" /> 8 - - <entry key="build.timestamp" value="${build.timestamp}" /> 9 - + <entry key="svn.version" value="@version@" /> 10 - + <entry key="build.timestamp" value="unknown" /> 11 - </propertyfile> 12 </target> 13 14 <!-- Compile the product itself (no tests). --> ··· 35 <mkdir dir="tmp/report"/> 36 <junit printsummary="yes" failureproperty="junit.failure" forkmode="once"> 37 38 - @@ -351,7 +351,7 @@ 39 - ignoreerrors="true"/> 40 - </target> 41 - 42 - - <target name="dist" depends="build, check-version, version-file" 43 - + <target name="dist" depends="build, version-file" 44 - description="Make the distribution area"> 45 - 46 - <mkdir dir="${dist}"/>
··· 1 --- a/build.xml (revision 4555) 2 +++ a/build.xml (working copy) 3 + @@ -228,7 +228,7 @@ 4 </target> 5 6 <!-- Compile the product itself (no tests). --> ··· 27 <mkdir dir="tmp/report"/> 28 <junit printsummary="yes" failureproperty="junit.failure" forkmode="once"> 29
+43 -18
pkgs/applications/misc/mkgmap/default.nix
··· 1 - { lib, stdenv 2 , fetchurl 3 , fetchsvn 4 - , substituteAll 5 , jdk 6 , jre 7 , ant ··· 24 }; 25 26 patches = [ 27 - (substituteAll { 28 - # Disable automatic download of dependencies 29 - src = ./build.xml.patch; 30 - inherit version; 31 - }) 32 ]; 33 34 postPatch = with deps; '' 35 mkdir -p lib/compile 36 cp ${fastutil} lib/compile/${fastutil.name} 37 cp ${osmpbf} lib/compile/${osmpbf.name} ··· 53 54 nativeBuildInputs = [ jdk ant makeWrapper ]; 55 56 - buildPhase = "ant"; 57 58 inherit doCheck; 59 60 - checkPhase = "ant test"; 61 62 installPhase = '' 63 install -Dm644 dist/mkgmap.jar -t $out/share/java/mkgmap 64 install -Dm644 dist/doc/mkgmap.1 -t $out/share/man/man1 65 cp -r dist/lib/ $out/share/java/mkgmap/ 66 makeWrapper ${jre}/bin/java $out/bin/mkgmap \ 67 --add-flags "-jar $out/share/java/mkgmap/mkgmap.jar" 68 - '' + lib.optionalString withExamples '' 69 - mkdir -p $out/share/mkgmap 70 - cp -r dist/examples $out/share/mkgmap/ 71 ''; 72 73 passthru.updateScript = [ ./update.sh "mkgmap" meta.downloadPage ]; 74 75 meta = with lib; { 76 description = "Create maps for Garmin GPS devices from OpenStreetMap (OSM) data"; 77 - homepage = "https://www.mkgmap.org.uk/"; 78 downloadPage = "https://www.mkgmap.org.uk/download/mkgmap.html"; 79 sourceProvenance = with sourceTypes; [ 80 fromSource 81 - binaryBytecode # deps 82 ]; 83 - license = licenses.gpl2Only; 84 - maintainers = with maintainers; [ sikmir ]; 85 - platforms = platforms.all; 86 - mainProgram = "mkgmap"; 87 }; 88 }
··· 1 + { lib 2 + , stdenv 3 , fetchurl 4 , fetchsvn 5 , jdk 6 , jre 7 , ant ··· 24 }; 25 26 patches = [ 27 + # Disable automatic download of dependencies 28 + ./build.xml.patch 29 + ./ignore-impure-test.patch 30 ]; 31 32 postPatch = with deps; '' 33 + # Fix the output jar timestamps for reproducibility 34 + substituteInPlace build.xml \ 35 + --replace-fail '<jar ' '<jar modificationtime="0" ' 36 + 37 + # Manually create version properties file for reproducibility 38 + mkdir -p build/classes 39 + cat > build/classes/mkgmap-version.properties << EOF 40 + svn.version=${version} 41 + build.timestamp=unknown 42 + EOF 43 + 44 + # Put pre-fetched dependencies into the right place 45 mkdir -p lib/compile 46 cp ${fastutil} lib/compile/${fastutil.name} 47 cp ${osmpbf} lib/compile/${osmpbf.name} ··· 63 64 nativeBuildInputs = [ jdk ant makeWrapper ]; 65 66 + buildPhase = '' 67 + runHook preBuild 68 + ant 69 + runHook postBuild 70 + ''; 71 72 inherit doCheck; 73 74 + checkPhase = '' 75 + runHook preCheck 76 + ant test 77 + runHook postCheck 78 + ''; 79 80 installPhase = '' 81 + runHook preInstall 82 + 83 install -Dm644 dist/mkgmap.jar -t $out/share/java/mkgmap 84 install -Dm644 dist/doc/mkgmap.1 -t $out/share/man/man1 85 cp -r dist/lib/ $out/share/java/mkgmap/ 86 makeWrapper ${jre}/bin/java $out/bin/mkgmap \ 87 --add-flags "-jar $out/share/java/mkgmap/mkgmap.jar" 88 + 89 + ${lib.optionalString withExamples '' 90 + mkdir -p $out/share/mkgmap 91 + cp -r dist/examples $out/share/mkgmap/ 92 + ''} 93 + 94 + runHook postInstall 95 ''; 96 97 passthru.updateScript = [ ./update.sh "mkgmap" meta.downloadPage ]; 98 99 meta = with lib; { 100 description = "Create maps for Garmin GPS devices from OpenStreetMap (OSM) data"; 101 downloadPage = "https://www.mkgmap.org.uk/download/mkgmap.html"; 102 + homepage = "https://www.mkgmap.org.uk/"; 103 + license = licenses.gpl2Only; 104 + mainProgram = "mkgmap"; 105 + maintainers = with maintainers; [ sikmir ]; 106 + platforms = platforms.all; 107 sourceProvenance = with sourceTypes; [ 108 fromSource 109 + binaryBytecode # deps 110 ]; 111 }; 112 + 113 }
+20
pkgs/applications/misc/mkgmap/ignore-impure-test.patch
···
··· 1 + diff --git a/test/uk/me/parabola/imgfmt/app/srt/SrtCollatorTest.java b/test/uk/me/parabola/imgfmt/app/srt/SrtCollatorTest.java 2 + index e1e4ac7..954b918 100644 3 + --- a/test/uk/me/parabola/imgfmt/app/srt/SrtCollatorTest.java 4 + +++ b/test/uk/me/parabola/imgfmt/app/srt/SrtCollatorTest.java 5 + @@ -17,6 +17,7 @@ import java.text.Collator; 6 + import uk.me.parabola.mkgmap.srt.SrtTextReader; 7 + 8 + import org.junit.Before; 9 + +import org.junit.Ignore; 10 + import org.junit.Test; 11 + 12 + import static org.junit.Assert.*; 13 + @@ -111,6 +112,7 @@ public class SrtCollatorTest { 14 + * meant to be identical to the java one. 15 + */ 16 + @Test 17 + + @Ignore 18 + public void testJavaRules() { 19 + Collator collator = Collator.getInstance(); 20 +
+1 -17
pkgs/applications/misc/mkgmap/splitter/build.xml.patch
··· 1 --- a/build.xml (revision 597) 2 +++ a/build.xml (working copy) 3 - @@ -207,12 +207,12 @@ 4 - <property name="svn.version.build" value="unknown"/> 5 - 6 - <propertyfile file="${build.classes}/splitter-version.properties"> 7 - - <entry key="svn.version" value="${svn.version.build}" /> 8 - - <entry key="build.timestamp" value="${build.timestamp}" /> 9 - + <entry key="svn.version" value="@version@" /> 10 - + <entry key="build.timestamp" value="unknown" /> 11 </propertyfile> 12 </target> 13 ··· 25 <javac srcdir="${test}" destdir="${build.test-classes}" debug="yes" includeantruntime="false"> 26 <include name="**/*.java"/> 27 <classpath refid="test.classpath"/> 28 - @@ -261,7 +261,7 @@ 29 - <fail if="junit.failure" message="Test failed. See test-reports/index.html"/> 30 - </target> 31 - 32 - - <target name="dist" depends="build, check-version, version-file" description="Make the distribution area"> 33 - + <target name="dist" depends="build, version-file" description="Make the distribution area"> 34 - 35 - <mkdir dir="${dist}"/> 36 - <mkdir dir="${dist}/doc/api"/> 37 @@ -324,7 +324,7 @@ 38 </target> 39
··· 1 --- a/build.xml (revision 597) 2 +++ a/build.xml (working copy) 3 + @@ -212,7 +212,7 @@ 4 </propertyfile> 5 </target> 6 ··· 18 <javac srcdir="${test}" destdir="${build.test-classes}" debug="yes" includeantruntime="false"> 19 <include name="**/*.java"/> 20 <classpath refid="test.classpath"/> 21 @@ -324,7 +324,7 @@ 22 </target> 23
+37 -15
pkgs/applications/misc/mkgmap/splitter/default.nix
··· 1 - { lib, stdenv 2 , fetchurl 3 , fetchsvn 4 - , substituteAll 5 , jdk 6 , jre 7 , ant ··· 23 }; 24 25 patches = [ 26 - (substituteAll { 27 - # Disable automatic download of dependencies 28 - src = ./build.xml.patch; 29 - inherit version; 30 - }) 31 - 32 # Fix func.SolverAndProblemGeneratorTest test 33 ./fix-failing-test.patch 34 ]; 35 36 postPatch = with deps; '' 37 mkdir -p lib/compile 38 cp ${fastutil} lib/compile/${fastutil.name} 39 cp ${osmpbf} lib/compile/${osmpbf.name} ··· 52 53 nativeBuildInputs = [ jdk ant makeWrapper ]; 54 55 - buildPhase = "ant"; 56 57 inherit doCheck; 58 59 - checkPhase = "ant run.tests && ant run.func-tests"; 60 61 installPhase = '' 62 install -Dm644 dist/splitter.jar -t $out/share/java/splitter 63 install -Dm644 doc/splitter.1 -t $out/share/man/man1 64 cp -r dist/lib/ $out/share/java/splitter/ 65 makeWrapper ${jre}/bin/java $out/bin/splitter \ 66 --add-flags "-jar $out/share/java/splitter/splitter.jar" 67 ''; 68 69 passthru.updateScript = [ ../update.sh "mkgmap-splitter" meta.downloadPage ]; 70 71 meta = with lib; { 72 description = "Utility for splitting OpenStreetMap maps into tiles"; 73 homepage = "https://www.mkgmap.org.uk/"; 74 - downloadPage = "https://www.mkgmap.org.uk/download/splitter.html"; 75 sourceProvenance = with sourceTypes; [ 76 fromSource 77 - binaryBytecode # deps 78 ]; 79 - license = licenses.gpl2Only; 80 - maintainers = with maintainers; [ sikmir ]; 81 - platforms = platforms.all; 82 }; 83 }
··· 1 + { lib 2 + , stdenv 3 , fetchurl 4 , fetchsvn 5 , jdk 6 , jre 7 , ant ··· 23 }; 24 25 patches = [ 26 + # Disable automatic download of dependencies 27 + ./build.xml.patch 28 # Fix func.SolverAndProblemGeneratorTest test 29 ./fix-failing-test.patch 30 ]; 31 32 postPatch = with deps; '' 33 + # Fix the output jar timestamps for reproducibility 34 + substituteInPlace build.xml \ 35 + --replace-fail '<jar ' '<jar modificationtime="0" ' 36 + 37 + # Manually create version properties file for reproducibility 38 + mkdir -p build/classes 39 + cat > build/classes/splitter-version.properties << EOF 40 + svn.version=${version} 41 + build.timestamp=unknown 42 + EOF 43 + 44 + # Put pre-fetched dependencies into the right place 45 mkdir -p lib/compile 46 cp ${fastutil} lib/compile/${fastutil.name} 47 cp ${osmpbf} lib/compile/${osmpbf.name} ··· 60 61 nativeBuildInputs = [ jdk ant makeWrapper ]; 62 63 + buildPhase = '' 64 + runHook preBuild 65 + ant 66 + runHook postBuild 67 + ''; 68 69 inherit doCheck; 70 71 + checkPhase = '' 72 + runHook preCheck 73 + ant run.tests 74 + ant run.func-tests 75 + runHook postCheck 76 + ''; 77 78 installPhase = '' 79 + runHook preInstall 80 + 81 install -Dm644 dist/splitter.jar -t $out/share/java/splitter 82 install -Dm644 doc/splitter.1 -t $out/share/man/man1 83 cp -r dist/lib/ $out/share/java/splitter/ 84 makeWrapper ${jre}/bin/java $out/bin/splitter \ 85 --add-flags "-jar $out/share/java/splitter/splitter.jar" 86 + 87 + runHook postInstall 88 ''; 89 90 passthru.updateScript = [ ../update.sh "mkgmap-splitter" meta.downloadPage ]; 91 92 meta = with lib; { 93 description = "Utility for splitting OpenStreetMap maps into tiles"; 94 + downloadPage = "https://www.mkgmap.org.uk/download/splitter.html"; 95 homepage = "https://www.mkgmap.org.uk/"; 96 + license = licenses.gpl2Only; 97 + mainProgram = "splitter"; 98 + maintainers = with maintainers; [ sikmir ]; 99 + platforms = platforms.all; 100 sourceProvenance = with sourceTypes; [ 101 fromSource 102 + binaryBytecode # deps 103 ]; 104 }; 105 }