2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv, fetchurl, jre }:
|
2014-11-22 23:35:04 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "zxing";
|
2014-11-22 23:35:04 +00:00
|
|
|
version = "3.1.0";
|
|
|
|
# Maven builds are hard to get right
|
|
|
|
core_jar = fetchurl {
|
|
|
|
url = "http://repo1.maven.org/maven2/com/google/zxing/core/${version}/core-${version}.jar";
|
|
|
|
sha256 = "199l4xvlcpafqn69r3k9qjpqkw9lvkl02hzpm0ackvdhl7vk42zh";
|
|
|
|
};
|
|
|
|
javase_jar = fetchurl {
|
|
|
|
url = "http://repo1.maven.org/maven2/com/google/zxing/javase/${version}/javase-${version}.jar";
|
|
|
|
sha256 = "0fzxvvf5dqyrs5m9rqw4ffm9h1s27bi7q3jb1dam34s80q2rp2zq";
|
|
|
|
};
|
|
|
|
inherit jre;
|
2019-06-19 16:45:34 +01:00
|
|
|
dontUnpack = true;
|
2014-11-22 23:35:04 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/lib/java" "$out/bin"
|
|
|
|
cp "${core_jar}" "${javase_jar}" "$out/lib/java"
|
|
|
|
substituteAll "${./java-zxing.sh}" "$out/bin/java-zxing"
|
|
|
|
substituteAll "${./zxing-cmdline-runner.sh}" "$out/bin/zxing-cmdline-runner"
|
|
|
|
substituteAll "${./zxing-cmdline-encoder.sh}" "$out/bin/zxing-cmdline-encoder"
|
|
|
|
substituteAll "${./zxing.sh}" "$out/bin/zxing"
|
|
|
|
chmod a+x "$out/bin"/*
|
|
|
|
cd "$out/lib/java"; for i in *.jar; do mv "$i" "''${i#*-}"; done
|
|
|
|
'';
|
|
|
|
meta = {
|
|
|
|
inherit version;
|
2021-01-24 09:19:10 +00:00
|
|
|
description = "1D and 2D code reading library";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = [lib.maintainers.raskin];
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/zxing/zxing";
|
2014-11-22 23:35:04 +00:00
|
|
|
};
|
|
|
|
}
|