-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calcmysky: New package #18697
Closed
Closed
calcmysky: New package #18697
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b0ee0d0
calcmysky: Add mingw64 and ucrt64 builds
hmartinez82 5f0af11
Add clang based builds
hmartinez82 9eb6fe4
Add -qt6 suffix
hmartinez82 e7949af
Removed -qt6 suffix
hmartinez82 27b33a2
Proper fix for DLL location instead of moving files
hmartinez82 67e4628
Add patch for dynamic library prefix
hmartinez82 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
mingw-w64-calcmysky/002-missing-symbol-clang-static-lib.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
diff -bur CalcMySky-0.3.1-orig/CMakeLists.txt CalcMySky-0.3.1/CMakeLists.txt | ||
--- CalcMySky-0.3.1-orig/CMakeLists.txt 2023-10-03 11:12:11.352394800 -0600 | ||
+++ CalcMySky-0.3.1/CMakeLists.txt 2023-10-03 11:13:15.279851400 -0600 | ||
@@ -111,16 +111,16 @@ | ||
# The first command is a dummy, it doesn't actually create its output: it's | ||
# only needed to force re-running of gen_version.cmake for the case when we've changed | ||
# the version but didn't touch other dependencies. | ||
-add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/check version update" COMMAND $<IF:$<BOOL:${WIN32}>,echo.,true>) | ||
-add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/version.cpp" | ||
- DEPENDS "${PROJECT_BINARY_DIR}/check version update" | ||
- WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" | ||
- COMMAND "${CMAKE_COMMAND}" | ||
- -D "staticVersion=${staticProjectVersion}" | ||
- -D "inputFile=${PROJECT_SOURCE_DIR}/version.cpp.in" | ||
- -D "outputFile=${PROJECT_BINARY_DIR}/version.cpp" | ||
- -P "${PROJECT_SOURCE_DIR}/cmake/gen_version.cmake") | ||
-add_library(version STATIC "${PROJECT_BINARY_DIR}/version.cpp") | ||
+# add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/check version update" COMMAND $<IF:$<BOOL:${WIN32}>,echo.,true>) | ||
+# add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/version.cpp" | ||
+# DEPENDS "${PROJECT_BINARY_DIR}/check version update" | ||
+# WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" | ||
+# COMMAND "${CMAKE_COMMAND}" | ||
+# -D "staticVersion=${staticProjectVersion}" | ||
+# -D "inputFile=${PROJECT_SOURCE_DIR}/version.cpp.in" | ||
+# -D "outputFile=${PROJECT_BINARY_DIR}/version.cpp" | ||
+# -P "${PROJECT_SOURCE_DIR}/cmake/gen_version.cmake") | ||
+# add_library(version STATIC "${PROJECT_BINARY_DIR}/version.cpp") | ||
add_library(common STATIC | ||
common/EclipsedDoubleScatteringPrecomputer.cpp | ||
common/TextureAverageComputer.cpp | ||
diff -bur CalcMySky-0.3.1-orig/config.h.in CalcMySky-0.3.1/config.h.in | ||
--- CalcMySky-0.3.1-orig/config.h.in 2023-10-03 11:12:11.352394800 -0600 | ||
+++ CalcMySky-0.3.1/config.h.in 2023-10-03 11:13:46.489890600 -0600 | ||
@@ -1,6 +1,6 @@ | ||
#pragma once | ||
|
||
-extern const char*const PROJECT_VERSION; | ||
+static const char*const PROJECT_VERSION = "@PROJECT_VERSION@"; | ||
#define DATA_ROOT_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}/" | ||
#define INSTALL_BINDIR "${CMAKE_INSTALL_FULL_BINDIR}/" | ||
#define BUILD_BINDIR "${CMAKE_BINARY_DIR}/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff -bur CalcMySky-0.3.1-orig/ShowMySky/CMakeLists.txt CalcMySky-0.3.1/ShowMySky/CMakeLists.txt | ||
--- CalcMySky-0.3.1-orig/ShowMySky/CMakeLists.txt 2023-10-03 12:55:58.401386500 -0600 | ||
+++ CalcMySky-0.3.1/ShowMySky/CMakeLists.txt 2023-10-03 12:56:49.974489900 -0600 | ||
@@ -58,7 +58,7 @@ | ||
install(TARGETS ShowMySky | ||
EXPORT ShowMySky-Qt${QT_VERSION}Config | ||
LIBRARY DESTINATION "${installLibDir}" | ||
- RUNTIME DESTINATION "${installLibDir}" | ||
+ RUNTIME DESTINATION "${installBinDir}" | ||
ARCHIVE DESTINATION "${installLibDir}" | ||
INCLUDES DESTINATION "${installIncDir}" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff -bur CalcMySky-0.3.1-orig/ShowMySky/api/ShowMySky/AtmosphereRenderer.hpp CalcMySky-0.3.1/ShowMySky/api/ShowMySky/AtmosphereRenderer.hpp | ||
--- CalcMySky-0.3.1-orig/ShowMySky/api/ShowMySky/AtmosphereRenderer.hpp 2023-10-03 16:27:38.436405700 -0600 | ||
+++ CalcMySky-0.3.1/ShowMySky/api/ShowMySky/AtmosphereRenderer.hpp 2023-10-03 16:27:49.348575900 -0600 | ||
@@ -306,7 +306,7 @@ | ||
* | ||
* This is the name that should be passed to dlopen-like functions. Use this macro for portability instead of hard-coding a string. | ||
*/ | ||
-#define SHOWMYSKY_LIB_NAME (QT_VERSION_MAJOR==5 ? "ShowMySky-Qt5" : "ShowMySky-Qt6") | ||
+#define SHOWMYSKY_LIB_NAME (QT_VERSION_MAJOR==5 ? "libShowMySky-Qt5" : "libShowMySky-Qt6") | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,90 @@ | ||||||
|
||||||
_realname=calcmysky | ||||||
pkgbase=mingw-w64-${_realname} | ||||||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" | ||||||
pkgver=0.3.1 | ||||||
pkgrel=1 | ||||||
pkgdesc="Planetary atmosphere light scattering simulator" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
arch=('any') | ||||||
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') | ||||||
url="https://10110111.github.io/CalcMySky" | ||||||
license=("spdx:GPL-3.0-only") | ||||||
makedepends=( | ||||||
"${MINGW_PACKAGE_PREFIX}-cc" | ||||||
"${MINGW_PACKAGE_PREFIX}-cmake" | ||||||
"${MINGW_PACKAGE_PREFIX}-doxygen" | ||||||
"${MINGW_PACKAGE_PREFIX}-glslang" | ||||||
"${MINGW_PACKAGE_PREFIX}-ninja" | ||||||
"${MINGW_PACKAGE_PREFIX}-qt6-tools" | ||||||
"${MINGW_PACKAGE_PREFIX}-shaderc" | ||||||
) | ||||||
depends=( | ||||||
"${MINGW_PACKAGE_PREFIX}-eigen3" | ||||||
"${MINGW_PACKAGE_PREFIX}-glm" | ||||||
"${MINGW_PACKAGE_PREFIX}-qt6-base" | ||||||
"${MINGW_PACKAGE_PREFIX}-vulkan-loader" | ||||||
) | ||||||
source=("https://github.com/10110111/CalcMySky/archive/refs/tags/v${pkgver}.tar.gz" | ||||||
"001-mingw.patch::https://github.com/10110111/CalcMySky/pull/17.patch" | ||||||
"002-missing-symbol-clang-static-lib.patch" | ||||||
"003-dll-install-location.patch" | ||||||
"004-dynamic-lib-prefix.patch") | ||||||
sha256sums=('d284eaabcf21ad3d1f520a1d1b1b533f7c5f5a44ba92495dd38e238874e8e4d7' | ||||||
'290b26213e9b139742135329df28ffb87dbb63db6809634dee013d0272f62756' | ||||||
'e951d29ba317118692d892472be02b8d5395fba2b3b39cafa8335164444f0651' | ||||||
'2ffbc317cd73a8b0653b5691b411cd47634e6d075fcc3ed16cf3913271b38275' | ||||||
'12ca2f34efc802a48676cf4ec2ddf1b2d7ad78a49d2de953f6934bc7efb11ab0') | ||||||
|
||||||
apply_patch_with_msg() { | ||||||
for _patch in "$@" | ||||||
do | ||||||
msg2 "Applying ${_patch}" | ||||||
patch -Nbp1 -i "${srcdir}/${_patch}" | ||||||
done | ||||||
} | ||||||
|
||||||
prepare() { | ||||||
cd "${srcdir}"/${_realname}-${pkgver} | ||||||
apply_patch_with_msg \ | ||||||
"001-mingw.patch" \ | ||||||
"002-missing-symbol-clang-static-lib.patch" \ | ||||||
"003-dll-install-location.patch" \ | ||||||
"004-dynamic-lib-prefix.patch" | ||||||
} | ||||||
|
||||||
build() { | ||||||
[[ -d "build-${MSYSTEM}" ]] && rm -rf "build-${MSYSTEM}" | ||||||
mkdir -p "${srcdir}/build-${MSYSTEM}" | ||||||
cd "${srcdir}/build-${MSYSTEM}" | ||||||
|
||||||
declare -a _extra_config | ||||||
if check_option "debug" "n"; then | ||||||
_extra_config+=("-DCMAKE_BUILD_TYPE=Release") | ||||||
else | ||||||
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug") | ||||||
fi | ||||||
|
||||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ | ||||||
${MINGW_PREFIX}/bin/cmake \ | ||||||
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ | ||||||
-G "Ninja" \ | ||||||
"${_extra_config[@]}" \ | ||||||
-DQT_VERSION=6 \ | ||||||
../${_realname}-${pkgver} | ||||||
|
||||||
${MINGW_PREFIX}/bin/cmake --build . | ||||||
|
||||||
${MINGW_PREFIX}/bin/cmake --build . --target doc | ||||||
} | ||||||
|
||||||
package() { | ||||||
cd "${srcdir}/build-${MSYSTEM}" | ||||||
|
||||||
DESTDIR=${pkgdir} ${MINGW_PREFIX}/bin/cmake.exe --install . | ||||||
|
||||||
install -vDm 644 ${srcdir}/${_realname}-${pkgver}/COPYING -t "${pkgdir}${MINGW_PREFIX}/share/licenses/$_realname/" | ||||||
|
||||||
# Install documentation | ||||||
install -vDm 644 ${srcdir}/build-${MSYSTEM}/doc/doxygen/html/*.* -t "${pkgdir}${MINGW_PREFIX}/share/doc/$_realname/" | ||||||
install -vDm 644 ${srcdir}/build-${MSYSTEM}/doc/doxygen/html/search/*.* -t "${pkgdir}${MINGW_PREFIX}/share/doc/$_realname/search/" | ||||||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for DLL name? DLL name can be without 'lib' prefix but import library name should have 'lib' prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for the DLL. But the DLL was created with the
lib
prefix. :( . I don't know why it was created with that prefix. I'll take a look again if I can find what is adding the prefix.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some projects add the following line for mingw only to prevent DLLs with 'lib' prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks! I'll look into that!