From c3b20dc648cfd02d3a26bbd6fab0db5a7d39fc05 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 16 Jan 2018 15:41:45 +0100 Subject: Fixed build scripts for use with the mercurial repository --- .gitignore | 11 ------ .hgignore | 3 ++ CMakeLists.txt | 6 ++-- linux/makepkg/PKGBUILD | 65 ++++++++++++++++++++++++++++++++++++ linux/makepkg/PKGBUILD.aqua | 58 -------------------------------- linux/makepkg/PKGBUILD.generic | 47 -------------------------- plugins/ProfileEditor/CMakeLists.txt | 2 ++ src/forms/aboutdialog.cpp | 4 +-- src/main.cpp | 4 +-- src/version.h.in | 8 ++--- tools/gen_authors.sh | 4 +-- 11 files changed, 82 insertions(+), 130 deletions(-) delete mode 100644 .gitignore create mode 100644 .hgignore create mode 100644 linux/makepkg/PKGBUILD delete mode 100644 linux/makepkg/PKGBUILD.aqua delete mode 100644 linux/makepkg/PKGBUILD.generic diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 2d6b408..0000000 --- a/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -# build folders -build* - -# QtCreator .pro.user settings -*.user - -# clion -.idea - -# python -__pycache__ diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..5cb74c5 --- /dev/null +++ b/.hgignore @@ -0,0 +1,3 @@ +# clion +cmake-build-* +.idea \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 0586b90..589ccfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,8 +52,8 @@ add_subdirectory(plugins/ProfileEditor) # configure a header file to pass version information # if you don't have git, or are building this off the source tarball, define versions in version.h.in -execute_process(COMMAND "git" "describe" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GitDescribe OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND "git" "describe" "--abbrev=0" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GitVersion OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND hg log -r '.' --template={latesttag} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VcsVersion OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND hg identify --id WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VcsCommit OUTPUT_STRIP_TRAILING_WHITESPACE) configure_file(src/version.h.in "${PROJECT_BINARY_DIR}/version.h") set(SourceCode @@ -116,4 +116,4 @@ target_link_libraries(poi Qt5::Core Qt5::Widgets Qt5::Concurrent Qt5::WebEngineW target_link_libraries(poi configuration) target_link_libraries(poi bookmarks downloads navigation) -install(TARGETS poi DESTINATION bin CONFIGURATIONS Release) +install(TARGETS poi RUNTIME DESTINATION bin CONFIGURATIONS Release) diff --git a/linux/makepkg/PKGBUILD b/linux/makepkg/PKGBUILD new file mode 100644 index 0000000..95a0a54 --- /dev/null +++ b/linux/makepkg/PKGBUILD @@ -0,0 +1,65 @@ +# Maintainer: Aqua-sama + +pkgname=smolbote-hg +pkgver=0.0.0 +pkgrel=1 +pkgdesc='Yet another no-frills browser' +url="https://neueland.iserlohn-fortress.net/smolbote" + +arch=('x86_64') +license=('GPL3') + +# -hg replace the old -git package +replaces=('smolbote-git') + +depends=('qt5-webengine' 'libconfig') +makedepends=('mercurial' 'cmake' 'pkg-config' 'ninja' 'qt5-webengine' 'libconfig') + +# this is the central repository +source=("smolbote-hg::hg+https://neueland.iserlohn-fortress.net/smolbote.hg") +# if you're test building, you want to hg serve your own repo +#source=("smolbote-hg::hg+http://localhost:8000") +sha512sums=('SKIP') + +# any patches go here +#prepare() { +#} + +pkgver() { + cd smolbote-hg + printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)" +} + +build() { + rm -rf "$pkgname-$pkgver" + mkdir "$pkgname-$pkgver" + cd "$pkgname-$pkgver" + + # CMake Options + # build type + _cmake_options="-DCMAKE_BUILD_TYPE=Release" + + # install prefix, or where should the binary be installed + _cmake_options="$_cmake_options -DCMAKE_INSTALL_PREFIX=$pkgdir/usr/local" + + # compiler + _cmake_options="$_cmake_options -DCMAKE_C_COMPILER=/usr/bin/clang" + _cmake_options="$_cmake_options -DCMAKE_CXX_COMPILER=/usr/bin/clang++" + + # use libc++ instead of libstdc++ + #_cmake_options="$_cmake_options -DUseLibCpp=On" + + # build system + _cmake_options="$_cmake_options -GNinja" + + # Generate a makefile + cmake $_cmake_options "$srcdir/smolbote-hg" + + # build + ninja +} + +package() { + cd "$pkgname-$pkgver" + ninja install +} diff --git a/linux/makepkg/PKGBUILD.aqua b/linux/makepkg/PKGBUILD.aqua deleted file mode 100644 index 72b8536..0000000 --- a/linux/makepkg/PKGBUILD.aqua +++ /dev/null @@ -1,58 +0,0 @@ -# Maintainer: Aqua-sama - -pkgname=smolbote-git -pkgver=0.0.0 -pkgrel=1 -pkgdesc='Yet another no-frills browser' -url="https://neueland.iserlohn-fortress.net/smolbote" - -arch=('x86_64') -license=('GPL3') - -depends=('qt5-webengine' 'libconfig') -makedepends=('git' 'cmake' 'pkg-config' 'ninja' 'qt5-webengine' 'libconfig') - -source=("smolbote-git::git+git://neueland.iserlohn-fortress.net/smolbote.git") -sha512sums=('SKIP') - -# any patches go here -#prepare() { -#} - -pkgver() { - cd smolbote-git - echo "$(git describe --long --tags | tr - .)" -} - -build() { - rm -rf "$pkgname-$pkgver" - mkdir "$pkgname-$pkgver" - cd "$pkgname-$pkgver" - - # CMake Options - # build type - _cmake_options="-DCMAKE_BUILD_TYPE=Release" - - # install prefix, or where should the binary be installed - _cmake_options="$_cmake_options -DCMAKE_INSTALL_PREFIX=$pkgdir/usr/local" - - # compiler - _cmake_options="$_cmake_options -DCMAKE_CXX_COMPILER=/usr/bin/clang++" - - # use libc++ instead of libstdc++ - #_cmake_options="$_cmake_options -DUseLibCpp=On" - - # build system - _cmake_options="$_cmake_options -GNinja" - - # Generate a makefile - cmake $_cmake_options "$srcdir/smolbote-git" - - # build - ninja -} - -package() { - cd "$pkgname-$pkgver" - ninja install -} diff --git a/linux/makepkg/PKGBUILD.generic b/linux/makepkg/PKGBUILD.generic deleted file mode 100644 index 98f132f..0000000 --- a/linux/makepkg/PKGBUILD.generic +++ /dev/null @@ -1,47 +0,0 @@ -# Maintainer: Aqua-sama - -pkgname=smolbote-git -pkgver=0.0.0 -pkgrel=1 -pkgdesc='Yet another no-frills browser' -url="https://neueland.iserlohn-fortress.net/smolbote" - -arch=('x86_64') -license=('GPL3') - -depends=('qt5-base' 'qt5-webengine') -makedepends=('git' 'cmake' 'libconfig' 'pkg-config') - -source=("smolbote-git::git+git://neueland.iserlohn-fortress.net/smolbote.git") -sha512sums=('SKIP') - -# any patches go here -#prepare() { -#} - -pkgver() { - cd smolbote-git - echo "$(git describe --long --tags | tr - .)" -} - -build() { - rm -rf "$pkgname-$pkgver" - mkdir "$pkgname-$pkgver" - cd "$pkgname-$pkgver" - - # Generate a makefile - # Adjust the install prefix as necessary, default is /usr/local/bin - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local "$srcdir/smolbote-git" - - # Use this if you want to link with libc++ instead - # This requires clang, since gcc doesn't understand the concept of not using libstdc++ - #cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DUseLibCpp=On "$srcdir/smolbote-git" - - # build, with 4 threads - make -} - -package() { - cd "$pkgname-$pkgver" - make DESTDIR="$pkgdir/" install -} diff --git a/plugins/ProfileEditor/CMakeLists.txt b/plugins/ProfileEditor/CMakeLists.txt index ee1af7f..a4a4005 100644 --- a/plugins/ProfileEditor/CMakeLists.txt +++ b/plugins/ProfileEditor/CMakeLists.txt @@ -19,3 +19,5 @@ target_include_directories(ProfileEditorPlugin target_link_libraries(ProfileEditorPlugin PRIVATE Qt5::Widgets PRIVATE Qt5::WebEngineWidgets) + +install(TARGETS ProfileEditorPlugin LIBRARY DESTINATION lib/smolbote CONFIGURATIONS Release) diff --git a/src/forms/aboutdialog.cpp b/src/forms/aboutdialog.cpp index e5dfc7d..93ee86b 100644 --- a/src/forms/aboutdialog.cpp +++ b/src/forms/aboutdialog.cpp @@ -24,8 +24,8 @@ constexpr const char *getCompiler() inline const QString getLongVersion() { -#ifdef GIT_DESCRIBE - return QString(GIT_DESCRIBE); +#ifdef SMOLBOTE_DESCRIBE + return QString(SMOLBOTE_DESCRIBE); #else return qApp->applicationVersion(); #endif diff --git a/src/main.cpp b/src/main.cpp index ca27783..fb80b7e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -60,8 +60,8 @@ int main(int argc, char *argv[]) { // Create application object Browser instance(argc, argv); -#ifdef GIT_VERSION - instance.setApplicationVersion(GIT_VERSION); +#ifdef SMOLBOTE_VERSION + instance.setApplicationVersion(SMOLBOTE_VERSION); #else instance.setApplicationVersion("1.0.0"); #endif diff --git a/src/version.h.in b/src/version.h.in index bcb28d3..0f597ed 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -1,9 +1,9 @@ #ifndef VERSION_H #define VERSION_H -// git describe --abbrev=0, 0.2.0 -#define GIT_VERSION "@GitVersion@" -// git describe, 0.2.0-15-g3b2d3c4 -#define GIT_DESCRIBE "@GitDescribe@" +// 0.2.1 +#define SMOLBOTE_VERSION "@VcsVersion@" +// 0.2.1-0fd54a21a551+ +#define SMOLBOTE_DESCRIBE "@VcsVersion@-@VcsCommit@" #endif //VERSION_H diff --git a/tools/gen_authors.sh b/tools/gen_authors.sh index 4f69c76..ed24634 100755 --- a/tools/gen_authors.sh +++ b/tools/gen_authors.sh @@ -15,8 +15,6 @@ # List of aliases # Aqua, Aqua-sama , Xian Nox, xiannox -git log --pretty="format:%an %ae" $1 \ - | sed -e 's/Aqua /Aqua-sama /g'\ - | sed -e 's/Xian Nox xian\.nox@gmail\.com/Aqua-sama aqua@iserlohn-fortress\.net/g'\ +hg log --template='{author}\n' \ | sort | uniq -c | sort -n -r \ | sed -e 's/^ *[0-9]* / /g' -- cgit v1.2.1