about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/le
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/le')
-rw-r--r--nixpkgs/pkgs/by-name/le/lemminx/package.nix105
-rw-r--r--nixpkgs/pkgs/by-name/le/lexmark-aex/package.nix78
2 files changed, 183 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/le/lemminx/package.nix b/nixpkgs/pkgs/by-name/le/lemminx/package.nix
new file mode 100644
index 000000000000..11fe3f070bba
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/le/lemminx/package.nix
@@ -0,0 +1,105 @@
+{ lib
+, fetchFromGitHub
+, makeWrapper
+, jre
+, maven
+, writeScript
+, lemminx
+}:
+
+maven.buildMavenPackage rec {
+  pname = "lemminx";
+  version = "0.27.0";
+
+  src = fetchFromGitHub {
+    owner = "eclipse";
+    repo = "lemminx";
+    rev = version;
+    hash = "sha256-VWYTkYlPziNRyxHdvIWVuDlABpKdzhC/F6BUBj/opks=";
+    # Lemminx reads this git information at runtime from a git.properties
+    # file on the classpath
+    leaveDotGit = true;
+    postFetch = ''
+      cat > $out/org.eclipse.lemminx/src/main/resources/git.properties << EOF
+      git.build.version=${version}
+      git.commit.id.abbrev=$(git -C $out rev-parse --short HEAD)
+      git.commit.message.short=$(git -C $out log -1 --pretty=format:%s)
+      git.branch=main
+      EOF
+      rm -rf $out/.git
+    '';
+  };
+
+  manualMvnArtifacts = [
+    "org.apache.maven.surefire:surefire-junit-platform:3.1.2"
+    "org.junit.platform:junit-platform-launcher:1.10.0"
+  ];
+
+  mvnHash = "sha256-sIiCp1AorVQXt13Tq0vw9jGioG3zcQMqqKS/Q0Tf4MQ=";
+
+  buildOffline = true;
+
+  # disable gitcommitid plugin which needs a .git folder which we
+  # don't have
+  mvnDepsParameters = "-Dmaven.gitcommitid.skip=true";
+
+  # disable failing tests which either need internet access or are flaky
+  mvnParameters = lib.escapeShellArgs [
+    "-Dmaven.gitcommitid.skip=true"
+    "-Dtest=!XMLValidationCommandTest,
+    !XMLValidationExternalResourcesBasedOnDTDTest,
+    !XMLSchemaPublishDiagnosticsTest,
+    !PlatformTest,
+    !XMLValidationExternalResourcesBasedOnXSDTest,
+    !XMLExternalTest,
+    !XMLSchemaCompletionExtensionsTest,
+    !XMLSchemaDiagnosticsTest,
+    !MissingChildElementCodeActionTest,
+    !XSDValidationExternalResourcesTest,
+    !DocumentLifecycleParticipantTest,
+    !DTDValidationExternalResourcesTest"
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin $out/share
+    install -Dm644 org.eclipse.lemminx/target/org.eclipse.lemminx-uber.jar \
+      $out/share
+
+    makeWrapper ${jre}/bin/java $out/bin/lemminx \
+      --add-flags "-jar $out/share/org.eclipse.lemminx-uber.jar"
+
+    runHook postInstall
+  '';
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  passthru.updateScript = writeScript "update-lemminx" ''
+    #!/usr/bin/env nix-shell
+    #!nix-shell -i bash -p curl pcre common-updater-scripts jq gnused
+    set -eu -o pipefail
+
+    LATEST_TAG=$(curl https://api.github.com/repos/eclipse/lemminx/tags | \
+      jq -r '[.[] | select(.name | test("^[0-9]"))] | sort_by(.name | split(".") |
+      map(tonumber)) | reverse | .[0].name')
+    update-source-version lemminx "$LATEST_TAG"
+    sed -i '0,/mvnHash *= *"[^"]*"/{s/mvnHash = "[^"]*"/mvnHash = ""/}' ${lemminx}
+
+    echo -e "\nFetching all mvn dependencies to calculate the mvnHash. This may take a while ..."
+    nix-build -A lemminx.fetchedMavenDeps 2> lemminx-stderr.log || true
+
+    NEW_MVN_HASH=$(cat lemminx-stderr.log | grep "got:" | awk '{print ''$2}')
+    rm lemminx-stderr.log
+    # escaping double quotes looks ugly but is needed for variable substitution
+    # use # instead of / as separator because the sha256 might contain the / character
+    sed -i "0,/mvnHash *= *\"[^\"]*\"/{s#mvnHash = \"[^\"]*\"#mvnHash = \"$NEW_MVN_HASH\"#}" ${lemminx}
+  '';
+
+  meta = with lib; {
+    description = "XML Language Server";
+    homepage = "https://github.com/eclipse/lemminx";
+    license = licenses.epl20;
+    maintainers = with maintainers; [ tricktron ];
+  };
+}
diff --git a/nixpkgs/pkgs/by-name/le/lexmark-aex/package.nix b/nixpkgs/pkgs/by-name/le/lexmark-aex/package.nix
new file mode 100644
index 000000000000..cfb02f70d6f3
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/le/lexmark-aex/package.nix
@@ -0,0 +1,78 @@
+{ lib
+, stdenv
+, cups
+, fetchurl
+, patchPpdFilesHook
+, autoPatchelfHook
+, dpkg
+, perl
+, avahi
+}:
+
+stdenv.mkDerivation {
+  pname = "lexmark-aex";
+  version = "1.0";
+
+  dontPatchELF = true;
+  dontStrip = true;
+
+  src = fetchurl {
+    url = "https://downloads.lexmark.com/downloads/drivers/Lexmark-AEX-PPD-Files-1.0-01242019.amd64.deb";
+    hash = "sha256-igrJEeFLArGbncOwk/WttnWfPjOokD0/IzpJ4VSOtHk=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    patchPpdFilesHook
+    dpkg
+  ];
+
+  buildInputs = [
+    # Needed for autoPatchelfHook.
+    avahi
+    cups
+    # Needed for patchShebangs.
+    perl
+  ];
+
+  # Needed for autoPatchelfHook.
+  runtimeDependencies = [ (lib.getLib cups) ];
+
+  ppdFileCommands = [ "CommandFileFilterG2" "rerouteprintoption" ];
+
+  installPhase = let
+    libdir =
+      if stdenv.system == "x86_64-linux"    then "lib64"
+      else if stdenv.system == "i686_linux" then "lib"
+      else throw "other platforms than i686_linux and x86_64-linux are not yet supported";
+  in ''
+    runHook preInstall
+
+    prefix=usr/local/Lexmark/ppd/Lexmark-AEX-PPD-Files/GlobalPPD_1.4
+
+    # Install raster image filter.
+    install -Dm755 "$prefix/rerouteprintoption" "$out/lib/cups/filter/rerouteprintoption"
+    patchShebangs "$out/lib/cups/filter/rerouteprintoption"
+
+    # Install additional binary filters.
+    for i in CommandFileFilterG2 LexHBPFilter; do
+      install -Dm755 "$prefix/${libdir}/$i" "$out/lib/cups/filter/$i"
+    done
+
+    # Install PPD.
+    install -Dm 0644 -t "$out/share/cups/model/Lexmark" "$prefix"/*.ppd
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "CUPS drivers for Lexmark B2200 and MB2200 Series printers";
+    homepage = "https://support.lexmark.com/en_xm/drivers-downloads.html";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.unfree;
+    maintainers = [ maintainers.tobim ];
+    platforms = [ "x86_64-linux" "i686-linux" ];
+  };
+}