Unverified Commit 858d5017 authored by Guy Chronister's avatar Guy Chronister
Browse files

analog: use finalAttrs, update fetchFromGitHub args, fix LANGDIR path

Switch to finalAttrs form, replace rev/sha256 with tag/hash, and hardcode
LANGDIR to "analog" instead of using ${pname} for consistency.
parent 1aecdfd4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -8,15 +8,15 @@
  libpng,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "analog";
  version = "6.0.18";

  src = fetchFromGitHub {
    owner = "c-amie";
    repo = "analog-ce";
    tag = version;
    sha256 = "sha256-NCturEibnpl6+paUZezksHzP33WtAzfIolvBLeEHXjY=";
    tag = finalAttrs.version;
    hash = "sha256-NCturEibnpl6+paUZezksHzP33WtAzfIolvBLeEHXjY=";
  };

  buildInputs = [
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
  postPatch = ''
    sed -i src/anlghead.h \
      -e "s|#define DEFAULTCONFIGFILE .*|#define DEFAULTCONFIGFILE \"$out/etc/analog.cfg\"|g" \
      -e "s|#define LANGDIR .*|#define LANGDIR \"$out/share/${pname}/lang/\"|g"
      -e "s|#define LANGDIR .*|#define LANGDIR \"$out/share/analog/lang/\"|g"
    substituteInPlace src/Makefile \
      --replace-fail "gcc" "${stdenv.cc.targetPrefix}cc" \
      --replace-fail "LIBS = -lm" "LIBS = -lm -lpng -lgd -ljpeg -lz -lbz2" \
@@ -54,4 +54,4 @@ stdenv.mkDerivation rec {
    mainProgram = "analog";
  };

}
})