nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit b62597d519f9ad22d7254ff36fe282223086ad8d
parent f41313d56a5e15ae6bb02365508e12ce603bb16e
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Fri,  8 Jan 2021 11:16:33 +0300

Add garminimg

Diffstat:
Mnix/sources.json | 14++++++++++++++
Mpkgs/default.nix | 3+++
Apkgs/tools/geo/garminimg/default.nix | 32++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/nix/sources.json b/nix/sources.json @@ -195,6 +195,20 @@ "url": "https://github.com/mhulden/foma/archive/b44022c7d9d347dc7392aabbf72c82e558767675.tar.gz", "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" }, + "garminimg": { + "branch": "main", + "builtin": false, + "date": "2021-01-05T11:21:46Z", + "description": "Encode/decode a Garmin IMG file", + "homepage": "https://github.com/kiozen/GarminImg", + "owner": "kiozen", + "repo": "GarminImg", + "rev": "049b10a35da548f032e7e1e3ce3e9ae8600fd83e", + "sha256": "1d80gxnb6qh3485d46vm0w5vw26b3a6jkbsi52hawwwh68a1knnw", + "type": "tarball", + "url": "https://github.com/kiozen/GarminImg/archive/049b10a35da548f032e7e1e3ce3e9ae8600fd83e.tar.gz", + "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" + }, "gdcv": { "branch": "master", "builtin": false, diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -160,6 +160,9 @@ lib.makeScope newScope ( }; fx-bin = callPackage ./tools/text/fx/bin.nix { }; garmin-uploader = callPackage ./tools/misc/garmin-uploader { }; + garminimg = libsForQt5.callPackage ./tools/geo/garminimg { + inherit sources; + }; gdcv = callPackage ./tools/dict/gdcv { }; gimgtools = callPackage ./tools/geo/gimgtools { }; gloggery = callPackage ./tools/misc/gloggery { }; diff --git a/pkgs/tools/geo/garminimg/default.nix b/pkgs/tools/geo/garminimg/default.nix @@ -0,0 +1,32 @@ +{ lib, mkDerivation, cmake, gdal, proj, sources }: + +mkDerivation { + pname = "garminimg"; + version = lib.substring 0 10 sources.garminimg.date; + + src = sources.garminimg; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace "PROJ4" "PROJ" + substituteInPlace srcEncodeImg/CMakeLists.txt \ + --replace "PROJ4_" "PROJ_" + substituteInPlace srcDecodeImg/CMakeLists.txt \ + --replace "PROJ4_" "PROJ_" + ''; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ gdal proj ]; + + hardeningDisable = [ "format" ]; + + installPhase = "install -Dm755 bin/* -t $out/bin"; + + meta = with lib; { + inherit (sources.garminimg) description homepage; + license = licenses.gpl3Plus; + maintainers = [ maintainers.sikmir ]; + platforms = platforms.unix; + }; +}