nur-packages

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

default.nix (1522B)


      1 { lib
      2 , stdenv
      3 , fetchzip
      4 , gcc-arm-embedded
      5 , zip
      6 , platform ? null
      7 , platformsub ? null
      8 , fi2key ? null
      9 , fi2iv ? null
     10 }:
     11 
     12 let
     13   version = "1.6.1";
     14   revision = "6261"; # check on http://mighty-hoernsche.de/
     15   branch = "release-${lib.replaceStrings [ "." ] [ "_" ] (lib.versions.majorMinor version)}";
     16   optFI2 = fi2key != null && fi2iv != null;
     17   batchBuild = platform == null || platformsub == null;
     18 in
     19 stdenv.mkDerivation {
     20   pname = "chdk";
     21   inherit version;
     22 
     23   src = fetchzip {
     24     url = "https://app.assembla.com/spaces/chdk/subversion/source/${revision}/branches/${branch}?_format=zip";
     25     extension = "zip";
     26     stripRoot = false;
     27     hash = "sha256-VNkPju3nVxk1g5SzRZok5994JVupySbO7KZsD6sgXo8=";
     28   };
     29 
     30   nativeBuildInputs = [ gcc-arm-embedded zip ];
     31 
     32   buildFlags = [ "DEF_SVN_REF=${revision}" "HOSTCC=${stdenv.cc.targetPrefix}cc" ]
     33     ++ lib.optionals (optFI2 && !batchBuild) [ "OPT_FI2=1" "FI2KEY=${fi2key}" "FI2IV=${fi2iv}" ]
     34     ++ lib.optionals (!batchBuild) [ "PLATFORM=${platform}" "PLATFORMSUB=${platformsub}" "firzipsubcomplete" ]
     35     ++ lib.optional batchBuild "batch-zip-complete";
     36 
     37   env.NIX_CFLAGS_COMPILE = "-Wno-format-security";
     38 
     39   installPhase = ''
     40     runHook preInstall
     41     install -Dm644 bin/*.zip -t $out
     42     runHook postInstall
     43   '';
     44 
     45   meta = with lib; {
     46     description = "Canon Hack Development Kit";
     47     homepage = "https://chdk.fandom.com/wiki/CHDK";
     48     license = licenses.gpl2;
     49     platforms = platforms.unix;
     50     maintainers = [ maintainers.sikmir ];
     51     skip.ci = true;
     52   };
     53 }