Skip to content

Commit 05da2da

Browse files
Punzohackermd
andauthored
lcms2 download zip folder (#5)
* Install lcms2 from archive * Update github workflows * Use ls instead of dir in build script Co-authored-by: hackermd <hackermd@protonmail.com>
1 parent 6669f1e commit 05da2da

7 files changed

Lines changed: 71 additions & 29 deletions

File tree

.github/workflows/run_unit_tests.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,35 @@ jobs:
4242
- name: Install yarn package manager
4343
run: npm install --global yarn
4444

45-
- name: Build and install Emscripten SDK
46-
run: |
47-
git clone https://github.com/emscripten-core/emsdk.git
48-
cd emsdk
49-
git pull
50-
./emsdk install latest
51-
./emsdk activate latest
52-
5345
- name: Build and install library
5446
run: |
55-
source ./emsdk/emsdk_env.sh
5647
mkdir build
5748
cd build
5849
cmake ..
5950
make
6051
sudo make install
6152
53+
- name: Build and install Emscripten SDK
54+
run: |
55+
git clone https://github.com/emscripten-core/emsdk.git
56+
cd emsdk
57+
git pull
58+
./emsdk install latest
59+
./emsdk activate latest
60+
source ./emsdk_env.sh
61+
6262
- name: Build WebAssembly bindings
6363
run: |
64+
yarn run clean
65+
sh ./emsdk/emsdk activate latest
6466
source ./emsdk/emsdk_env.sh
6567
yarn run build
6668
6769
- name: Perform npm package publish dry run
68-
run: npm publish . --dry-run
70+
run: |
71+
sh ./emsdk/emsdk activate latest
72+
source ./emsdk/emsdk_env.sh
73+
npm publish . --dry-run
6974
7075
macos:
7176
name: Build and run tests on macOS
@@ -78,7 +83,16 @@ jobs:
7883
run: |
7984
brew update
8085
brew upgrade
81-
brew install autoconf automake cmake emscripten libtool llvm node yarn
86+
brew install \
87+
autoconf \
88+
automake \
89+
cmake \
90+
emscripten \
91+
libtool \
92+
little-cms2 \
93+
llvm \
94+
node \
95+
yarn
8296
8397
- name: Build and install library
8498
run: |
@@ -89,7 +103,9 @@ jobs:
89103
make install
90104
91105
- name: Build WebAssembly bindings
92-
run: yarn run build
106+
run: |
107+
yarn run clean
108+
yarn run build
93109
94110
- name: Perform npm package publish dry run
95111
run: npm publish . --dry-run

BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ After building the WebAssembly bindings and JavaScript API, the browser based ex
6464
python -m SimpleHTTPServer # Python 2
6565
```
6666

67-
and then pointing the browser to ``http://localhost:8000/browser``.
67+
and then pointing the browser to ``http://localhost:8000/wasm/examples/browser/``.

CMakeLists.txt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,7 @@ endif()
3333

3434
if(EMSCRIPTEN)
3535
set(BUILD_SHARED_LIBS OFF)
36-
include(ExternalProject)
37-
ExternalProject_Add(lcms2
38-
GIT_REPOSITORY https://github.com/mm2/Little-CMS.git
39-
GIT_TAG master
40-
BUILD_IN_SOURCE 1
41-
CONFIGURE_COMMAND autoreconf -fvi && ./configure
42-
BUILD_COMMAND make
43-
INSTALL_COMMAND ""
44-
TEST_COMMAND ""
45-
)
46-
47-
set(LCMS2_LIBRARY "${CMAKE_BINARY_DIR}/lcms2-prefix/src/lcms2/src/.libs/liblcms2.a" CACHE INTERNAL "" FORCE)
48-
set(LCMS2_INCLUDE_DIR "${CMAKE_BINARY_DIR}/lcms2-prefix/src/lcms2/include" CACHE INTERNAL "" FORCE)
49-
36+
add_subdirectory(thirdparty)
5037
add_subdirectory(src)
5138
add_subdirectory(wasm)
5239
else()

build-wasm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ cp ./build/wasm/dicomiccwasm.js ./dist
1717
cp ./build/wasm/dicomiccwasm.wasm ./dist
1818

1919
echo "~~~ BUILD:"
20-
(cd build && dir)
20+
(cd build && ls)
2121
echo "~~~ DIST:"
22-
(cd dist && dir)
22+
(cd dist && ls)

thirdparty/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
message(STATUS "building lcms2 from source")
2+
3+
add_subdirectory(liblcms2)

thirdparty/liblcms2/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
include(ExternalProject)
2+
ExternalProject_Add(lcms2download
3+
PREFIX lcms2-build
4+
URL https://github.com/mm2/Little-CMS/releases/download/lcms2.13.1/lcms2-2.13.1.zip
5+
URL_HASH SHA256=4ea5cba9772182e641bf7acc2a4ee65f73b3718d47bcc4e71381e1b7b01a49d7
6+
BUILD_IN_SOURCE 1
7+
CONFIGURE_COMMAND autoreconf -fvi && ./configure -enable-static --prefix=${CMAKE_BINARY_DIR}/thirdparty/lcms2-install
8+
BUILD_COMMAND make
9+
INSTALL_COMMAND make install
10+
TEST_COMMAND ""
11+
UPDATE_COMMAND ""
12+
)
13+
14+
set(LCMS2_LIBRARY "${CMAKE_BINARY_DIR}/thirdparty/lcms2-install/lib/liblcms2.a" CACHE INTERNAL "" FORCE)
15+
set(LCMS2_INCLUDE_DIR "${CMAKE_BINARY_DIR}/thirdparty/lcms2-install/include" CACHE INTERNAL "" FORCE)

thirdparty/liblcms2/COPYING

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Little CMS
2+
Copyright (c) 1998-2020 Marti Maria Saguer
3+
4+
Permission is hereby granted, free of charge, to any person obtaining
5+
a copy of this software and associated documentation files (the
6+
"Software"), to deal in the Software without restriction, including
7+
without limitation the rights to use, copy, modify, merge, publish,
8+
distribute, sublicense, and/or sell copies of the Software, and to
9+
permit persons to whom the Software is furnished to do so, subject
10+
to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)