diff --git a/pkgs/applications/misc/mkgmap/testinputs.nix b/pkgs/applications/misc/mkgmap/testinputs.nix deleted file mode 100644 index c92499aea5c7e..0000000000000 --- a/pkgs/applications/misc/mkgmap/testinputs.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ fetchurl }: -let - fetchTestInput = - { res, sha256 }: - fetchurl { - inherit sha256; - url = "https://www.mkgmap.org.uk/testinput/${res}"; - name = builtins.replaceStrings [ "/" ] [ "__" ] res; - }; -in -[ - (fetchTestInput { - res = "osm/lon1.osm.gz"; - sha256 = "1r8sl67hayjgybxy9crqwp7f1w0ljxvxh0apqcvr888yhsbb8drv"; - }) - (fetchTestInput { - res = "osm/uk-test-1.osm.gz"; - sha256 = "0jdngkjn22jvi8q7hrzpqb9mnjlz82h1dwdmc4qrb64kkhzm4dfk"; - }) - (fetchTestInput { - res = "osm/uk-test-2.osm.gz"; - sha256 = "05mw0qcdgki151ldmxayry0gqlb72jm5wrvxq3dkwq5i7jb21qs4"; - }) - (fetchTestInput { - res = "osm/is-in-samples.osm"; - sha256 = "18vqfbq25ys59bj6dl6dq3q4m2ri3ki2xazim14fm94k1pbyhbh3"; - }) - (fetchTestInput { - res = "mp/test1.mp"; - sha256 = "1dykr0z84c3fqgm9kdp2dzvxc3galjbx0dn9zxjw8cfk7mvnspj2"; - }) - (fetchTestInput { - res = "img/63240001.img"; - sha256 = "1wmqgy940q1svazw85z8di20xyjm3vpaiaj9hizr47b549klw74q"; - }) - (fetchTestInput { - res = "img/63240002.img"; - sha256 = "12ivywkiw6lrglyk0clnx5ff2wqj4z0c3f5yqjsqlsaawbmxqa1f"; - }) - (fetchTestInput { - res = "img/63240003.img"; - sha256 = "19mgxqv6kqk8ahs8s819sj7cc79id67373ckwfsq7vvqyfrbasz1"; - }) - (fetchTestInput { - res = "hgt/N00W090.hgt.zip"; - sha256 = "16hb06bgf47sz2mfbbx3xqmrh1nmm04wj4ngm512sng4rjhksxgn"; - }) - (fetchTestInput { - res = "hgt/N00W091.hgt.zip"; - sha256 = "153j4wj7170qj81nr7sr6dp9zar62gnrkh6ww62bygpfqqyzdr1x"; - }) - (fetchTestInput { - res = "hgt/S01W090.hgt.zip"; - sha256 = "0czgs9rhp7bnzmzm7907vprj3nhm2lj6q1piafk8dm9rcqkfg8sj"; - }) - (fetchTestInput { - res = "hgt/S01W091.hgt.zip"; - sha256 = "0z58q3ai499mflxfjqhqv9i1di3fmp05pkv39886k1na107g3wbn"; - }) - (fetchTestInput { - res = "hgt/S02W090.hgt.zip"; - sha256 = "0q7817gdxk2vq73ci6ffks288zqywc21f5ns73b6p5ds2lrxhf5n"; - }) - (fetchTestInput { - res = "hgt/S02W091.hgt.zip"; - sha256 = "1mwpgd85v9n99gmx2bn8md7d312wvhq86w3c9k92y8ayrs20lmdr"; - }) -] diff --git a/pkgs/applications/misc/mkgmap/splitter/build.xml.patch b/pkgs/by-name/mk/mkgmap-splitter/build.xml.patch similarity index 89% rename from pkgs/applications/misc/mkgmap/splitter/build.xml.patch rename to pkgs/by-name/mk/mkgmap-splitter/build.xml.patch index 1fb0a14ef4c3a..9b0db9c58a94f 100644 --- a/pkgs/applications/misc/mkgmap/splitter/build.xml.patch +++ b/pkgs/by-name/mk/mkgmap-splitter/build.xml.patch @@ -1,5 +1,5 @@ ---- a/build.xml (revision 597) -+++ a/build.xml (working copy) +--- a/build.xml 2026-02-10 03:53:33.129313250 +0200 ++++ b/build.xml 2026-02-10 03:53:36.908100965 +0200 @@ -212,7 +212,7 @@ @@ -9,7 +9,7 @@ -@@ -219,7 +219,7 @@ +@@ -222,7 +222,7 @@ @@ -18,7 +18,7 @@ -@@ -324,7 +324,7 @@ +@@ -330,7 +330,7 @@ @@ -27,7 +27,7 @@ -@@ -349,7 +349,7 @@ +@@ -355,7 +355,7 @@ ignoreerrors="true"/> diff --git a/pkgs/applications/misc/mkgmap/splitter/fix-failing-test.patch b/pkgs/by-name/mk/mkgmap-splitter/fix-failing-test.patch similarity index 100% rename from pkgs/applications/misc/mkgmap/splitter/fix-failing-test.patch rename to pkgs/by-name/mk/mkgmap-splitter/fix-failing-test.patch diff --git a/pkgs/applications/misc/mkgmap/splitter/default.nix b/pkgs/by-name/mk/mkgmap-splitter/package.nix similarity index 59% rename from pkgs/applications/misc/mkgmap/splitter/default.nix rename to pkgs/by-name/mk/mkgmap-splitter/package.nix index fea9619173f76..67adcb1b10beb 100644 --- a/pkgs/applications/misc/mkgmap/splitter/default.nix +++ b/pkgs/by-name/mk/mkgmap-splitter/package.nix @@ -7,21 +7,23 @@ jre, ant, makeWrapper, + mkgmap, stripJavaArchivesHook, doCheck ? true, }: + let - deps = import ../deps.nix { inherit fetchurl; }; + inherit (mkgmap) deps; testInputs = import ./testinputs.nix { inherit fetchurl; }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "splitter"; version = "654"; src = fetchsvn { url = "https://svn.mkgmap.org.uk/mkgmap/splitter/trunk"; - rev = version; - sha256 = "sha256-y/pl8kIQ6fiF541ho72LMgJFWJdkUBqPToQGCGmmcfg="; + rev = finalAttrs.version; + hash = "sha256-y/pl8kIQ6fiF541ho72LMgJFWJdkUBqPToQGCGmmcfg="; }; patches = [ @@ -31,33 +33,31 @@ stdenv.mkDerivation rec { ./fix-failing-test.patch ]; - postPatch = - with deps; - '' - # Manually create version properties file for reproducibility - mkdir -p build/classes - cat > build/classes/splitter-version.properties << EOF - svn.version=${version} - build.timestamp=unknown - EOF + postPatch = '' + # Manually create version properties file for reproducibility + mkdir -p build/classes + cat > build/classes/splitter-version.properties << EOF + svn.version=${finalAttrs.version} + build.timestamp=unknown + EOF - # Put pre-fetched dependencies into the right place - mkdir -p lib/compile - cp ${fastutil} lib/compile/${fastutil.name} - cp ${osmpbf} lib/compile/${osmpbf.name} - cp ${protobuf} lib/compile/${protobuf.name} - cp ${xpp3} lib/compile/${xpp3.name} - '' - + lib.optionalString doCheck '' - mkdir -p lib/test - cp ${junit} lib/test/${junit.name} - cp ${hamcrest-core} lib/test/${hamcrest-core.name} + # Put pre-fetched dependencies into the right place + mkdir -p lib/compile + cp ${deps.fastutil} lib/compile/${deps.fastutil.name} + cp ${deps.osmpbf} lib/compile/${deps.osmpbf.name} + cp ${deps.protobuf} lib/compile/${deps.protobuf.name} + cp ${deps.xpp3} lib/compile/${deps.xpp3.name} + '' + + lib.optionalString doCheck '' + mkdir -p lib/test + cp ${deps.junit} lib/test/${deps.junit.name} + cp ${deps.hamcrest-core} lib/test/${deps.hamcrest-core.name} - mkdir -p test/resources/in/osm - ${lib.concatMapStringsSep "\n" (res: '' - cp ${res} test/resources/in/${builtins.replaceStrings [ "__" ] [ "/" ] res.name} - '') testInputs} - ''; + mkdir -p test/resources/in/osm + ${lib.concatMapStringsSep "\n" (res: '' + cp ${res} test/resources/in/${builtins.replaceStrings [ "__" ] [ "/" ] res.name} + '') testInputs} + ''; nativeBuildInputs = [ jdk @@ -94,9 +94,9 @@ stdenv.mkDerivation rec { ''; passthru.updateScript = [ - ../update.sh + ./update.sh "mkgmap-splitter" - meta.downloadPage + finalAttrs.meta.downloadPage ]; meta = { @@ -112,4 +112,4 @@ stdenv.mkDerivation rec { binaryBytecode # deps ]; }; -} +}) diff --git a/pkgs/applications/misc/mkgmap/splitter/testinputs.nix b/pkgs/by-name/mk/mkgmap-splitter/testinputs.nix similarity index 63% rename from pkgs/applications/misc/mkgmap/splitter/testinputs.nix rename to pkgs/by-name/mk/mkgmap-splitter/testinputs.nix index 462e8bfa0bebf..9b0a74730fd14 100644 --- a/pkgs/applications/misc/mkgmap/splitter/testinputs.nix +++ b/pkgs/by-name/mk/mkgmap-splitter/testinputs.nix @@ -1,9 +1,9 @@ { fetchurl }: let fetchTestInput = - { res, sha256 }: + { res, hash }: fetchurl { - inherit sha256; + inherit hash; url = "https://www.mkgmap.org.uk/testinput/${res}"; name = builtins.replaceStrings [ "/" ] [ "__" ] res; }; @@ -11,10 +11,10 @@ in [ (fetchTestInput { res = "osm/alaska-2016-12-27.osm.pbf"; - sha256 = "0hmb5v71a1bxgvrg1cbfj5l27b3vvdazs4pyggpmhcdhbwpw7ppm"; + hash = "sha256-9d7DL1+wMVjve/4S/VXbe6wjaJFusfDyfn0FFc4uq0I="; }) (fetchTestInput { res = "osm/hamburg-2016-12-26.osm.pbf"; - sha256 = "08bny4aavwm3z2114q99fv3fi2w905zxi0fl7bqgjyhgk0fxjssf"; + hash = "sha256-TmvZHZgPevnwOtSB2H8BiYvoxnYpYRKC+KPyrRTxdiE="; }) ] diff --git a/pkgs/applications/misc/mkgmap/update.sh b/pkgs/by-name/mk/mkgmap-splitter/update.sh similarity index 100% rename from pkgs/applications/misc/mkgmap/update.sh rename to pkgs/by-name/mk/mkgmap-splitter/update.sh diff --git a/pkgs/applications/misc/mkgmap/build.xml.patch b/pkgs/by-name/mk/mkgmap/build.xml.patch similarity index 78% rename from pkgs/applications/misc/mkgmap/build.xml.patch rename to pkgs/by-name/mk/mkgmap/build.xml.patch index 567c0d5586f85..bd1d9ab19c0ee 100644 --- a/pkgs/applications/misc/mkgmap/build.xml.patch +++ b/pkgs/by-name/mk/mkgmap/build.xml.patch @@ -1,29 +1,29 @@ ---- a/build.xml (revision 4555) -+++ a/build.xml (working copy) -@@ -228,7 +228,7 @@ +--- a/build.xml ++++ b/build.xml +@@ -228,8 +228,7 @@ - + - - +- description="main compilation"> ++ + -@@ -263,7 +263,7 @@ + +@@ -264,7 +263,7 @@ - + - + -@@ -271,7 +271,7 @@ +@@ -275,7 +274,7 @@ - + - + - diff --git a/pkgs/applications/misc/mkgmap/deps.nix b/pkgs/by-name/mk/mkgmap/deps.nix similarity index 61% rename from pkgs/applications/misc/mkgmap/deps.nix rename to pkgs/by-name/mk/mkgmap/deps.nix index 68cd5a79fe720..858b6c0f0aae2 100644 --- a/pkgs/applications/misc/mkgmap/deps.nix +++ b/pkgs/by-name/mk/mkgmap/deps.nix @@ -2,30 +2,30 @@ { fastutil = fetchurl { url = "http://ivy.mkgmap.org.uk/repo/it.unimi.dsi/fastutil/6.5.15-mkg.1b/jars/fastutil.jar"; - sha256 = "0d88m0rpi69wgxhnj5zh924q4zsvxq8m4ybk7m9mr3gz1hx0yx8c"; + hash = "sha256-DHUPOgz/jVxTPXN5UhHuW3+CiUjwF2lhfzyZeDOoCDU="; }; osmpbf = fetchurl { url = "http://ivy.mkgmap.org.uk/repo/crosby/osmpbf/1.3.3/jars/osmpbf.jar"; - sha256 = "0zb4pqkwly5z30ww66qhhasdhdrzwmrw00347yrbgyk2ii4wjad3"; + hash = "sha256-oynJSYxi+reyP2QAwHPlPzfYtIIQG8M5GL94yie+ZH0="; }; protobuf = fetchurl { url = "mirror://maven/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar"; - sha256 = "0x6c4pbsizvk3lm6nxcgi1g2iqgrxcna1ip74lbn01f0fm2wdhg0"; + hash = "sha256-4MHGRXXABWAXJefGoCzr+eEoXoiPdWsqHXP/qNclzHQ="; }; xpp3 = fetchurl { url = "mirror://maven/xpp3/xpp3/1.1.4c/xpp3-1.1.4c.jar"; - sha256 = "1f9ifnxxj295xb1494jycbfm76476xm5l52p7608gf0v91d3jh83"; + hash = "sha256-A0E5WkgbuIeAOVcUWmo3h5hT3WJekkTC6iUJ2bt1Mbk="; }; jaxb-api = fetchurl { url = "mirror://maven/javax/xml/bind/jaxb-api/2.3.0/jaxb-api-2.3.0.jar"; - sha256 = "00rxpc0m30d3jc572ni01ryxq8gcbnr955xsabrijg9pknc0fc48"; + hash = "sha256-iDAHmJ03PRnzUrqXkrJd7CHcfQ4gWnEKk6OBUQG7PQM="; }; junit = fetchurl { url = "mirror://maven/junit/junit/4.11/junit-4.11.jar"; - sha256 = "1zh6klzv8w30dx7jg6pkhllk4587av4znflzhxz8x97c7rhf3a4h"; + hash = "sha256-kKjhYD7spI5+h586+8lWBxUyKYXzmidPb2BwtD+dBv4="; }; hamcrest-core = fetchurl { url = "mirror://maven/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"; - sha256 = "1sfqqi8p5957hs9yik44an3lwpv8ln2a6sh9gbgli4vkx68yzzb6"; + hash = "sha256-Zv3vkelzk0jfeglqo4SlaF9Oh1WEzOiThqekclHE2Ok="; }; } diff --git a/pkgs/applications/misc/mkgmap/ignore-impure-test.patch b/pkgs/by-name/mk/mkgmap/ignore-impure-test.patch similarity index 100% rename from pkgs/applications/misc/mkgmap/ignore-impure-test.patch rename to pkgs/by-name/mk/mkgmap/ignore-impure-test.patch diff --git a/pkgs/applications/misc/mkgmap/default.nix b/pkgs/by-name/mk/mkgmap/package.nix similarity index 56% rename from pkgs/applications/misc/mkgmap/default.nix rename to pkgs/by-name/mk/mkgmap/package.nix index 09b42f21039ce..8eeda4ec15596 100644 --- a/pkgs/applications/misc/mkgmap/default.nix +++ b/pkgs/by-name/mk/mkgmap/package.nix @@ -11,18 +11,19 @@ doCheck ? true, withExamples ? false, }: + let deps = import ./deps.nix { inherit fetchurl; }; testInputs = import ./testinputs.nix { inherit fetchurl; }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "mkgmap"; version = "4924"; src = fetchsvn { url = "https://svn.mkgmap.org.uk/mkgmap/mkgmap/trunk"; - rev = version; - sha256 = "sha256-4DGGAWgyIvK5pcopwlO4YDGDc73lOsL0Ljy/kFUY2As="; + rev = finalAttrs.version; + hash = "sha256-4DGGAWgyIvK5pcopwlO4YDGDc73lOsL0Ljy/kFUY2As="; }; patches = [ @@ -31,36 +32,34 @@ stdenv.mkDerivation rec { ./ignore-impure-test.patch ]; - postPatch = - with deps; - '' - # Manually create version properties file for reproducibility - mkdir -p build/classes - cat > build/classes/mkgmap-version.properties << EOF - svn.version=${version} - build.timestamp=unknown - EOF - - # Put pre-fetched dependencies into the right place - mkdir -p lib/compile - cp ${fastutil} lib/compile/${fastutil.name} - cp ${osmpbf} lib/compile/${osmpbf.name} - cp ${protobuf} lib/compile/${protobuf.name} - '' - + lib.optionalString doCheck '' - mkdir -p lib/test - cp ${fastutil} lib/test/${fastutil.name} - cp ${osmpbf} lib/test/${osmpbf.name} - cp ${protobuf} lib/test/${protobuf.name} - cp ${jaxb-api} lib/test/${jaxb-api.name} - cp ${junit} lib/test/${junit.name} - cp ${hamcrest-core} lib/test/${hamcrest-core.name} - - mkdir -p test/resources/in/img - ${lib.concatMapStringsSep "\n" (res: '' - cp ${res} test/resources/in/${builtins.replaceStrings [ "__" ] [ "/" ] res.name} - '') testInputs} - ''; + postPatch = '' + # Manually create version properties file for reproducibility + mkdir -p build/classes + cat > build/classes/mkgmap-version.properties << EOF + svn.version=${finalAttrs.version} + build.timestamp=unknown + EOF + + # Put pre-fetched dependencies into the right place + mkdir -p lib/compile + cp ${deps.fastutil} lib/compile/${deps.fastutil.name} + cp ${deps.osmpbf} lib/compile/${deps.osmpbf.name} + cp ${deps.protobuf} lib/compile/${deps.protobuf.name} + '' + + lib.optionalString doCheck '' + mkdir -p lib/test + cp ${deps.fastutil} lib/test/${deps.fastutil.name} + cp ${deps.osmpbf} lib/test/${deps.osmpbf.name} + cp ${deps.protobuf} lib/test/${deps.protobuf.name} + cp ${deps.jaxb-api} lib/test/${deps.jaxb-api.name} + cp ${deps.junit} lib/test/${deps.junit.name} + cp ${deps.hamcrest-core} lib/test/${deps.hamcrest-core.name} + + mkdir -p test/resources/in/img + ${lib.concatMapStringsSep "\n" (res: '' + cp ${res} test/resources/in/${builtins.replaceStrings [ "__" ] [ "/" ] res.name} + '') testInputs} + ''; nativeBuildInputs = [ jdk @@ -100,11 +99,14 @@ stdenv.mkDerivation rec { runHook postInstall ''; - passthru.updateScript = [ - ./update.sh - "mkgmap" - meta.downloadPage - ]; + passthru = { + inherit deps; + updateScript = [ + ./update.sh + "mkgmap" + finalAttrs.meta.downloadPage + ]; + }; meta = { description = "Create maps for Garmin GPS devices from OpenStreetMap (OSM) data"; @@ -119,5 +121,4 @@ stdenv.mkDerivation rec { binaryBytecode # deps ]; }; - -} +}) diff --git a/pkgs/by-name/mk/mkgmap/testinputs.nix b/pkgs/by-name/mk/mkgmap/testinputs.nix new file mode 100644 index 0000000000000..e99705d851cea --- /dev/null +++ b/pkgs/by-name/mk/mkgmap/testinputs.nix @@ -0,0 +1,68 @@ +{ fetchurl }: +let + fetchTestInput = + { res, hash }: + fetchurl { + inherit hash; + url = "https://www.mkgmap.org.uk/testinput/${res}"; + name = builtins.replaceStrings [ "/" ] [ "__" ] res; + }; +in +[ + (fetchTestInput { + res = "osm/lon1.osm.gz"; + hash = "sha256-Oze0loYeIZQ3w1cB2HeXFPDgzuU4s+T78k96BY+hGuU="; + }) + (fetchTestInput { + res = "osm/uk-test-1.osm.gz"; + hash = "sha256-0zVSP5yTmJUxYbXxFqBAn0pb08L3Z3gwilsKYeV8tkk="; + }) + (fetchTestInput { + res = "osm/uk-test-2.osm.gz"; + hash = "sha256-ROMgljyxYD7bwH1nXqoUZ1H8gM9e9dpoKCHO1xgGvBY="; + }) + (fetchTestInput { + res = "osm/is-in-samples.osm"; + hash = "sha256-Ay7o1w2TpOpIqPGrLuIcMYtK8MDN0GbkSkX7IvByeKM="; + }) + (fetchTestInput { + res = "mp/test1.mp"; + hash = "sha256-Ql5tdz3TMcRl/8k20Jek6g3W92/itpnqw24wgj7I07c="; + }) + (fetchTestInput { + res = "img/63240001.img"; + hash = "sha256-mBxOZyJlHZJ/hEmqqO4eVfoORGzoF8S/2jpgQJJ/uPI="; + }) + (fetchTestInput { + res = "img/63240002.img"; + hash = "sha256-Lijc6+JKaYq1xL64wcAnEnPhXOmWMjA9fZkaHif3O4o="; + }) + (fetchTestInput { + res = "img/63240003.img"; + hash = "sha256-4Wu1svN474O145ONM45pMR3GjtQpII00VGjiaTbur6Y="; + }) + (fetchTestInput { + res = "hgt/N00W090.hgt.zip"; + hash = "sha256-9nU9oczkWS1Cqc8SyQmo1QaYK+6jr+Wq+PoQ95YBC5o="; + }) + (fetchTestInput { + res = "hgt/N00W091.hgt.zip"; + hash = "sha256-PeT2PcbuPr+E4dzAme0TJqufbjNZn2wDkhiccCQncpQ="; + }) + (fetchTestInput { + res = "hgt/S01W090.hgt.zip"; + hash = "sha256-UqPnJmY51YamU/EGbCQVFdoh890HpFN//XadC3PS7zM="; + }) + (fetchTestInput { + res = "hgt/S01W091.hgt.zip"; + hash = "sha256-dvHxDgjKhmkQSmPPW8CtbsQWYtoYYuk6dTUlEtXAqHw="; + }) + (fetchTestInput { + res = "hgt/S02W090.hgt.zip"; + hash = "sha256-tjjYMxW6lWvWONoWFwTjHn+EhJ7OmcjGwVvM3t4J6GA="; + }) + (fetchTestInput { + res = "hgt/S02W091.hgt.zip"; + hash = "sha256-uVUKhM5eIS/STGxwgzDcXITRTqvILtHrS8mmXVB7l9c="; + }) +] diff --git a/pkgs/by-name/mk/mkgmap/update.sh b/pkgs/by-name/mk/mkgmap/update.sh new file mode 100755 index 0000000000000..ddfca9359359d --- /dev/null +++ b/pkgs/by-name/mk/mkgmap/update.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl common-updater-scripts + +set -euo pipefail + +version=$(curl -s $2 | sed -n 's#.*\(.*\).*#\1#p') +update-source-version $1 "$version" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4579e14b233f9..103a534e3c9e9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3092,10 +3092,6 @@ with pkgs; nvfetcher = haskell.lib.compose.justStaticExecutables haskellPackages.nvfetcher; - mkgmap = callPackage ../applications/misc/mkgmap { }; - - mkgmap-splitter = callPackage ../applications/misc/mkgmap/splitter { }; - op-geth = callPackage ../applications/blockchains/optimism/geth.nix { }; optimism = callPackage ../applications/blockchains/optimism { };