From c881f96620c7e6ccce08d3877889e474f838c039 Mon Sep 17 00:00:00 2001 From: Grigory Pomadchin Date: Fri, 19 Jan 2024 10:17:22 -0500 Subject: [PATCH] publish scripts update and README.md --- scripts/README.md | 6 ++++++ scripts/crosscompile-linux.sh | 2 +- scripts/docker/2.6.0/ubuntu/Dockerfile | 8 ++++++++ scripts/publish-local-native.sh | 2 +- scripts/publish-local.sh | 2 +- scripts/publish-native.sh | 2 +- scripts/publish.sh | 2 +- 7 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 scripts/README.md mode change 100644 => 100755 scripts/crosscompile-linux.sh diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..64fb915 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,6 @@ +# PDAL Java publish scripts + +This is a set of not well maintained scripts that were used to publish PDAL from a Mac laptop. +Crosscompilation idea in this case is to build linux binaries in a docker conatiner, mac binaries locally, pack all the outputs into the jar. + +Similar result is achieved via CI at this point. diff --git a/scripts/crosscompile-linux.sh b/scripts/crosscompile-linux.sh old mode 100644 new mode 100755 index b88cbba..a785074 --- a/scripts/crosscompile-linux.sh +++ b/scripts/crosscompile-linux.sh @@ -6,4 +6,4 @@ docker run -it --rm \ -v $HOME/.ivy2:/root/.ivy2 \ -v $HOME/.sbt:/root/.sbt \ -v $HOME/.coursier/cache:/root/.cache/coursier \ - daunnc/pdal-ubuntu:2.6.0 bash -c "cd ./pdal-java; ./sbt native/compile" + daunnc/pdal-ubuntu:2.6.0 bash -c "cd ./pdal-java; sbt native/compile" diff --git a/scripts/docker/2.6.0/ubuntu/Dockerfile b/scripts/docker/2.6.0/ubuntu/Dockerfile index b3f55cc..2c1ccbb 100644 --- a/scripts/docker/2.6.0/ubuntu/Dockerfile +++ b/scripts/docker/2.6.0/ubuntu/Dockerfile @@ -12,6 +12,14 @@ RUN update-alternatives --set java `update-alternatives --list java | grep java- RUN apt-get -y install bash gcc g++ cmake wget unzip gpg software-properties-common +# Install SBT +RUN apt-get install -y curl gnupg && \ + echo 'deb https://repo.scala-sbt.org/scalasbt/debian all main' | tee /etc/apt/sources.list.d/sbt.list && \ + echo 'deb https://repo.scala-sbt.org/scalasbt/debian /' | tee /etc/apt/sources.list.d/sbt_old.list && \ + curl -sL 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823' | apt-key add - && \ + apt-get update && \ + apt-get install -y sbt + RUN ln -s /opt/conda/envs/pdal/include/pdal /usr/include/pdal && \ ln -s /usr/include /usr/lib/include && \ ln -s /opt/conda/envs/pdal/lib /usr/lib/lib && \ diff --git a/scripts/publish-local-native.sh b/scripts/publish-local-native.sh index ca612bc..a647c6f 100755 --- a/scripts/publish-local-native.sh +++ b/scripts/publish-local-native.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash ./scripts/crosscompile-linux.sh && \ -./sbt native/publishLocal +sbt native/publishLocal diff --git a/scripts/publish-local.sh b/scripts/publish-local.sh index 04726cd..08e9bb4 100755 --- a/scripts/publish-local.sh +++ b/scripts/publish-local.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -PDAL_DEPEND_ON_NATIVE=false ./sbt ";+core/publishLocal;+core-scala/publishLocal" +PDAL_DEPEND_ON_NATIVE=false sbt ";+core/publishLocal;+core-scala/publishLocal" diff --git a/scripts/publish-native.sh b/scripts/publish-native.sh index a78ccfb..a16d7ed 100755 --- a/scripts/publish-native.sh +++ b/scripts/publish-native.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash ./scripts/crosscompile-linux.sh && \ -./sbt native/publishSigned +sbt native/publishSigned diff --git a/scripts/publish.sh b/scripts/publish.sh index 861e0a2..03f9115 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -PDAL_DEPEND_ON_NATIVE=false ./sbt ";+core;publishSigned;+core-scala/publishSigned" +PDAL_DEPEND_ON_NATIVE=false sbt ";+core;publishSigned;+core-scala/publishSigned"