Merge pull request #19547 from podsvirov/leocad-new-package

leocad: new package
This commit is contained in:
Konstantin Podsvirov
2023-12-27 20:40:13 +03:00
committed by GitHub
2 changed files with 141 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
diff -Naur leocad-23.03.origin/leocad.pro leocad-23.03/leocad.pro
--- leocad-23.03.origin/leocad.pro 2023-03-20 02:09:47.000000000 +0300
+++ leocad-23.03/leocad.pro 2023-12-25 23:41:57.637237400 +0300
@@ -53,7 +53,7 @@
}
isEmpty(QMAKE_LRELEASE) {
- win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
+ !win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
unix {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt4 }
@@ -92,7 +92,7 @@
unix:!macx {
TARGET = leocad
} else {
- TARGET = LeoCAD
+ TARGET = leocad
}
CONFIG(debug, debug|release) {
@@ -106,7 +106,7 @@
RCC_DIR = $$DESTDIR/.qrc
UI_DIR = $$DESTDIR/.ui
-unix:!macx {
+win32 {
isEmpty(INSTALL_PREFIX):INSTALL_PREFIX = /usr
isEmpty(BIN_DIR):BIN_DIR = $$INSTALL_PREFIX/bin
isEmpty(DOCS_DIR):DOCS_DIR = $$INSTALL_PREFIX/share/doc/leocad
@@ -116,14 +116,14 @@
isEmpty(MIME_DIR):MIME_DIR = $$INSTALL_PREFIX/share/mime/packages
isEmpty(APPDATA_DIR):APPDATA_DIR = $$INSTALL_PREFIX/share/metainfo
- target.path = $$BIN_DIR
- docs.path = $$DOCS_DIR
+ target.path = $$PREFIX/bin
+ docs.path = $$PREFIX/share/doc/leocad
docs.files = docs/README.md docs/CREDITS.txt docs/COPYING.txt
- man.path = $$MAN_DIR
+ man.path = $$PREFIX/share/man/man1
man.files = docs/leocad.1
- desktop.path = $$DESKTOP_DIR
+ desktop.path = $$PREFIX/share/applications
desktop.files = qt/leocad.desktop
- icons.path = $$ICON_DIR/hicolor
+ icons.path = $$PREFIX/share/icons/hicolor
icons.files += tools/icon/128x128
icons.files += tools/icon/16x16
icons.files += tools/icon/24x24
@@ -133,9 +133,9 @@
icons.files += tools/icon/512x512
icons.files += tools/icon/64x64
icons.files += tools/icon/scalable
- mime.path = $$MIME_DIR
+ mime.path = $$PREFIX/share/mime/packages
mime.files = qt/leocad.xml
- appdata.path = $$APPDATA_DIR
+ appdata.path = $$PREFIX/share/metainfo
appdata.files = tools/setup/leocad.appdata.xml
INSTALLS += target docs man desktop icons mime appdata
diff -Naur leocad-23.03.origin/qt/qtmain.cpp leocad-23.03/qt/qtmain.cpp
--- leocad-23.03.origin/qt/qtmain.cpp 2023-03-20 02:09:47.000000000 +0300
+++ leocad-23.03/qt/qtmain.cpp 2023-12-25 23:42:07.382339500 +0300
@@ -189,7 +189,7 @@
LibraryPaths += qMakePair(QDir::cleanPath(QCoreApplication::applicationDirPath() + "/library.bin"), true);
#endif
-#ifdef Q_OS_LINUX
+#ifdef Q_OS_WIN
LibraryPaths += qMakePair(QDir::cleanPath(QCoreApplication::applicationDirPath() + "/../share/leocad/library.bin"), true);
#endif

67
mingw-w64-leocad/PKGBUILD Normal file
View File

@@ -0,0 +1,67 @@
# Maintainer: Konstantin Podsvirov <konstantin@podsvirov.pro>
_realname=leocad
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=23.03
_libver=23.06
pkgrel=1
pkgdesc='A CAD program for creating virtual LEGO models (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64')
url='https://leocad.org'
msys2_repository_url='https://github.com/leozide/leocad'
license=('GPL')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-qt5-tools")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-qt5-base"
"${MINGW_PACKAGE_PREFIX}-hicolor-icon-theme"
"${MINGW_PACKAGE_PREFIX}-zlib")
optdepends=("${MINGW_PACKAGE_PREFIX}-qt5-tools: Designer plugin")
source=("${msys2_repository_url}/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz"
"${msys2_repository_url}/releases/download/v${pkgver}/Library-${_libver}.zip"
'0001-leocad-23.03-fix-install.patch')
sha256sums=('69a45c60898ed07d8cf7e714442b201b0da3adc073287170eb6f46901e4604ce'
'ef29c1e0fc989c9e9894072f43ae0030a5274c0cdcc831bc6c206bbe059f449b'
'850e7fb4f1d43f6d865284e7338628c5d29aa20d03b99f71c2fb4ac356ad3fba')
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 \
0001-leocad-23.03-fix-install.patch
}
build() {
[[ -d "${srcdir}/build-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}"
mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"
MSYS2_ARG_CONV_EXCL="INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/qmake.exe \
INSTALL_PREFIX=${MINGW_PREFIX} \
DISABLE_UPDATE_CHECK=1 \
../${_realname}-${pkgver}/${_realname}.pro
make
}
package() {
cd "${srcdir}/build-${MSYSTEM}"
make INSTALL_ROOT="${pkgdir}${MINGW_PREFIX}" install
install -Dm644 "${srcdir}/library.bin" -t "${pkgdir}${MINGW_PREFIX}/share/leocad"
}
# vim:set ts=2 sw=2 et: