1 { lib, stdenv, fetchurl, jre }:
2 stdenv.mkDerivation rec {
5 # Maven builds are hard to get right
7 url = "http://repo1.maven.org/maven2/com/google/zxing/core/${version}/core-${version}.jar";
8 sha256 = "199l4xvlcpafqn69r3k9qjpqkw9lvkl02hzpm0ackvdhl7vk42zh";
10 javase_jar = fetchurl {
11 url = "http://repo1.maven.org/maven2/com/google/zxing/javase/${version}/javase-${version}.jar";
12 sha256 = "0fzxvvf5dqyrs5m9rqw4ffm9h1s27bi7q3jb1dam34s80q2rp2zq";
17 mkdir -p "$out/lib/java" "$out/bin"
18 cp "${core_jar}" "${javase_jar}" "$out/lib/java"
19 substituteAll "${./java-zxing.sh}" "$out/bin/java-zxing"
20 substituteAll "${./zxing-cmdline-runner.sh}" "$out/bin/zxing-cmdline-runner"
21 substituteAll "${./zxing-cmdline-encoder.sh}" "$out/bin/zxing-cmdline-encoder"
22 substituteAll "${./zxing.sh}" "$out/bin/zxing"
23 chmod a+x "$out/bin"/*
24 cd "$out/lib/java"; for i in *.jar; do mv "$i" "''${i#*-}"; done
27 description = "1D and 2D code reading library";
28 sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
29 license = lib.licenses.asl20;
30 maintainers = [lib.maintainers.raskin];
31 platforms = lib.platforms.linux;
32 homepage = "https://github.com/zxing/zxing";