summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrey Christoforo2021-01-31 17:28:21 +0100
committerGrey Christoforo2021-01-31 17:28:21 +0100
commita404fd68d5f5f46b1e28ba7d542e597e6ee0300e (patch)
tree6cd8e81d21aa61ca7245449cc2a9b9a93835f4cc
parent6123ee497dd4d7311c22016380baa9585983d973 (diff)
downloadaur-a404fd68d5f5f46b1e28ba7d542e597e6ee0300e.tar.gz
working
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD39
-rw-r--r--fix-install-dir-references.patch24
3 files changed, 51 insertions, 16 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c6804963035..022e60290b1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -8,16 +8,16 @@ pkgbase = occt-webgl-viewer
license = custom
makedepends = tk
makedepends = gl2ps
- makedepends = ffmpeg
- makedepends = freeimage
makedepends = emscripten
makedepends = cmake
makedepends = ninja
options = !buildflags
source = opencascade-7.5.0.tgz::https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V7_5_0;sf=tgz
source = freetype-2.10.4.tar.xz::https://download-mirror.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.xz
+ source = fix-install-dir-references.patch
sha256sums = c8df7d23051b86064f61299a5f7af30004c115bdb479df471711bab0c7166654
sha256sums = 86a854d8905b19698bbc8f23b860bc104246ce4854dcea8e3b0fb21284f75784
+ sha256sums = afb584aa453993ae8d9e2b983594558531ede735a5892754b812be30650c9fb5
pkgname = occt-webgl-viewer
diff --git a/PKGBUILD b/PKGBUILD
index 9f66068dc4e..68cb00e81d0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,8 +13,6 @@ depends=()
makedepends=(
tk
gl2ps
-ffmpeg
-freeimage
emscripten
cmake
ninja
@@ -23,13 +21,16 @@ options=(!buildflags)
source=(
"opencascade-${pkgver}.tgz::https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/${_pkgver};sf=tgz"
"freetype-${_ftver}.tar.xz::https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${_ftver}.tar.xz"
+fix-install-dir-references.patch
)
sha256sums=('c8df7d23051b86064f61299a5f7af30004c115bdb479df471711bab0c7166654'
- '86a854d8905b19698bbc8f23b860bc104246ce4854dcea8e3b0fb21284f75784')
+ '86a854d8905b19698bbc8f23b860bc104246ce4854dcea8e3b0fb21284f75784'
+ 'afb584aa453993ae8d9e2b983594558531ede735a5892754b812be30650c9fb5')
prepare() {
- cd "occt-${_pkgver}"
+ cd occt-${_pkgver}
+ patch -Np1 -i "${srcdir}/fix-install-dir-references.patch"
}
build() {
@@ -42,7 +43,7 @@ build() {
-G Ninja \
-B ft_build \
-S .
- DESTDIR="${srcdir}/freetype-${_ftver}/install" emmake cmake --build ft_build -- install
+ DESTDIR=install emmake cmake --build ft_build -- install
popd
msg2 "building occt for the web"
@@ -51,22 +52,26 @@ build() {
-D BUILD_MODULE_Draw=NO \
-D BUILD_LIBRARY_TYPE=Static \
-D BUILD_DOC_Overview=NO \
- -D 3RDPARTY_FREETYPE_LIBRARY="${srcdir}/freetype-${_ftver}/install/usr/local/lib/libfreetype.a" \
- -D 3RDPARTY_FREETYPE_LIBRARY_DIR="${srcdir}/freetype-${_ftver}/install/usr/local/lib" \
- -D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build="${srcdir}/freetype-${_ftver}/install/usr/local/include/freetype2" \
- -D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2="${srcdir}/freetype-${_ftver}/install/usr/local/include/freetype2" \
+ -D 3RDPARTY_FREETYPE_LIBRARY="${srcdir}/freetype-${_ftver}/ft_build/install/usr/local/lib/libfreetype.a" \
+ -D 3RDPARTY_FREETYPE_LIBRARY_DIR="${srcdir}/freetype-${_ftver}/ft_build/install/usr/local/lib" \
+ -D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build="${srcdir}/freetype-${_ftver}/ft_build/install/usr/local/include/freetype2" \
+ -D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2="${srcdir}/freetype-${_ftver}/ft_build/install/usr/local/include" \
-G Ninja \
-B occt_build \
-S .
- emmake cmake --build occt_build
- pushd occt_build
- emmake make DESTDIR="${srcdir}/occt-${_pkgver}/install" install
- popd
+ DESTDIR=install emmake cmake --build occt_build -- install
+ #emmake cmake --build occt_build
+ #pushd occt_build
+ #emmake ninja install
+ #emmake make DESTDIR="${srcdir}/occt-${_pkgver}/install" install
+ #popd
popd
msg2 "building WebGL viewer example"
pushd occt-${_pkgver}/samples/webgl
emcmake cmake -Wno-dev \
+ -D freetype_DIR="${srcdir}/freetype-${_ftver}/ft_build/install/usr/local/lib/cmake/freetype" \
+ -D OpenCASCADE_DIR="${srcdir}/occt-${_pkgver}/occt_build/install/usr/local/lib/cmake/opencascade" \
-G Ninja \
-B web_build \
-S .
@@ -75,8 +80,14 @@ build() {
package() {
source /etc/profile.d/emscripten.sh
- cd occt-${_pkgver}/samples/webgl
+ cd occt-${_pkgver}
+
+ pushd samples/webgl
DESTDIR="${pkgdir}/opt/${pkgname}" emmake cmake --build web_build -- install
+ popd
+
+ install -m644 -Dt "${pkgdir}/opt/${pkgname}/usr/local/samples" data/occ/Ball.brep
+ cp "${pkgdir}/opt/${pkgname}"/usr/local/*.html "${pkgdir}/opt/${pkgname}"/usr/local/index.html
install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE_LGPL_21.txt
install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" OCCT_LGPL_EXCEPTION.txt
diff --git a/fix-install-dir-references.patch b/fix-install-dir-references.patch
new file mode 100644
index 00000000000..0d3c8c8330d
--- /dev/null
+++ b/fix-install-dir-references.patch
@@ -0,0 +1,24 @@
+diff -aur occt-V7_1_0/CMakeLists.txt occt-V7_1_0.new/CMakeLists.txt
+--- occt-V7_1_0/CMakeLists.txt 2016-11-25 11:50:18.000000000 +0100
++++ occt-V7_1_0.new/CMakeLists.txt 2017-03-18 08:44:10.406668714 +0100
+@@ -906,7 +906,7 @@
+ endforeach()
+ # install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration
+ install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)")
+-install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)")
++install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"\$ENV{DESTDIR}${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)")
+
+ foreach (OCCT_MODULE ${OCCT_MODULES})
+ if (BUILD_MODULE_${OCCT_MODULE})
+diff -aur occt-V7_1_0/adm/cmake/occt_macros.cmake occt-V7_1_0.new/adm/cmake/occt_macros.cmake
+--- occt-V7_1_0/adm/cmake/occt_macros.cmake 2016-11-25 11:50:18.000000000 +0100
++++ occt-V7_1_0.new/adm/cmake/occt_macros.cmake 2017-03-18 08:44:10.406668714 +0100
+@@ -558,7 +558,7 @@
+ "cmake_policy(PUSH)
+ cmake_policy(SET CMP0007 NEW)
+ string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
+- file (GLOB ALL_OCCT_TARGET_FILES \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
++ file (GLOB ALL_OCCT_TARGET_FILES \"\$ENV{DESTDIR}${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
+ foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES})
+ file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT)
+ file (REMOVE \"\${TARGET_FILENAME}\")