From 2c3c7cc3477619b08a360381ffd39bd38f1d8b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 8 Nov 2021 09:57:33 +0100 Subject: [PATCH] garmin-plugin: switch to fetchFromGitHub, minor formatting, cleanup meta --- .../misc/garmin-plugin/default.nix | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/misc/garmin-plugin/default.nix b/pkgs/applications/misc/garmin-plugin/default.nix index 724f2aeee62a..c401b2722565 100644 --- a/pkgs/applications/misc/garmin-plugin/default.nix +++ b/pkgs/applications/misc/garmin-plugin/default.nix @@ -1,28 +1,39 @@ -{ lib, stdenv, fetchurl, garmintools, libgcrypt, libusb-compat-0_1, pkg-config, tinyxml, zlib }: +{ lib, stdenv, fetchFromGitHub, garmintools, libgcrypt, libusb-compat-0_1, pkg-config, tinyxml, zlib }: + stdenv.mkDerivation rec { pname = "garmin-plugin"; version = "0.3.26"; - src = fetchurl { - url = "https://github.com/adiesner/GarminPlugin/archive/V${version}.tar.gz"; - sha256 = "15gads1fj4sj970m5960dgnhys41ksi4cm53ldkf67wn8dc9i4k0"; + src = fetchFromGitHub { + owner = "adiesner"; + repo = "GarminPlugin"; + rev = "V${version}"; + sha256 = "sha256-l0WAbEsQl1dCADf5gTepYjsA1rQCJMLcrTxRR4PfUus="; }; - sourceRoot = "GarminPlugin-${version}/src"; + + preConfigure = '' + cd src + ''; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ garmintools libusb-compat-0_1 libgcrypt tinyxml zlib ]; + configureFlags = [ "--with-libgcrypt-prefix=${libgcrypt.dev}" "--with-garmintools-incdir=${garmintools}/include" "--with-garmintools-libdir=${garmintools}/lib" ]; + installPhase = '' mkdir -p $out/lib/mozilla/plugins cp npGarminPlugin.so $out/lib/mozilla/plugins ''; - meta = { - homepage = "http://www.andreas-diesner.de/garminplugin"; - license = lib.licenses.gpl3; - maintainers = [ ]; - platforms = lib.platforms.linux; + + meta = with lib; { + homepage = "https://adiesner.github.io/GarminPlugin/"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ ]; + platforms = platforms.linux; }; }