Browse Source

First pass at converting from qmake to cmake.

Jeremy Borgman 4 years ago
parent
commit
f5013df306

+ 6 - 0
.clang-tidy

@@ -0,0 +1,6 @@
+
+---
+Checks:          '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm-*'
+WarningsAsErrors: '*'
+HeaderFilterRegex: ''
+FormatStyle:     none

+ 18 - 0
.cmake-format.yaml

@@ -0,0 +1,18 @@
+additional_commands:
+  foo:
+    flags:
+    - BAR
+    - BAZ
+    kwargs:
+      DEPENDS: '*'
+      HEADERS: '*'
+      SOURCES: '*'
+bullet_char: '*'
+dangle_parens: false
+enum_char: .
+line_ending: unix
+line_width: 120
+max_pargs_hwrap: 3
+separate_ctrl_name_with_space: false
+separate_fn_name_with_space: false
+tab_size: 2

+ 2 - 0
.gitignore

@@ -49,6 +49,8 @@ stage/
 .snapcraft/
 flameshot*.tar.bz2
 
+.vscode/
+build/
 
 # NVIM
 *~

+ 0 - 98
.travis.yml

@@ -1,98 +0,0 @@
-dist: xenial
-sudo: required
-
-language: cpp
-
-branches:
-  only:
-    - master
-
-cache:
-    directories:
-      - $HOME/.cache
- 
-env:
-    global:
-      # Environment variables for packaging
-      - PRODUCT=flameshot
-      - VERSION=0.6.0
-      - RELEASE=1
-      - ARCH=x86_64
-      # Dockerfile from https://github.com/flameshotapp/flameshot-docker-images
-      - DOCKER_REPO=vitzy/flameshot
-      # Option: wetransfer.com, file.io, 0x0.st, transfer.sh
-      - UPLOAD_SERVICE=wetransfer.com
-
-# The actual list of distribution is available on
-# https://hub.docker.com/r/vitzy/flameshot/tags/
-matrix:
-    include:
-        - os: linux
-          # 28
-          env: OS=fedora DIST=28 EXTEN=rpm
-          services: docker
-        - os: linux
-          # 29
-          env: OS=fedora DIST=29 EXTEN=rpm
-          services: docker
-        - os: linux
-          # 30
-          env: OS=fedora DIST=30 EXTEN=rpm
-          services: docker
-        - os: linux
-          # 16.04 LTS
-          env: OS=ubuntu DIST=xenial EXTEN=deb
-          services: docker
-        - os: linux
-          # 18.04 LTS
-          env: OS=ubuntu DIST=bionic EXTEN=deb
-          services: docker
-        - os: linux
-          # 19.04
-          env: OS=ubuntu DIST=disco EXTEN=deb
-          services: docker
-        - os: linux
-          # 8
-          env: OS=debian DIST=jessie EXTEN=deb
-          services: docker
-        - os: linux
-          # 9
-          env: OS=debian DIST=stretch EXTEN=deb
-          services: docker
-        - os: linux
-          # No docker environment, just for CI build & test
-          # ubuntu xenial;  default Qt version is 5.6.1
-          env: OS=ubuntu DIST=xenial EXTEN=other
-#       - os: osx
-#         compiler: clang
-#         osx_image: xcode9.2
-
-before_install:
-  - export ROOT_PATH="$(pwd)"
-  - chmod +x .travis/*.sh
-  - chmod +x .travis/services/*.sh
-  - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_before_install.sh; fi
-
-install:
-  - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_install.sh; fi
-
-script:
-# - git submodule update --init --recursive
-# - git describe --long
-  - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_script.sh; fi
-# - if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then source .travis/osx_script.sh; fi
-
-after_success:
-  - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_after_success.sh; fi
-  - echo "Download URL is $TEMP_DOWNLOAD_URL ."
-
-# deploy:
-#    # Deploy packages to Github Release
-#    provider: releases
-#    api_key: "GITHUB ENCYPTED OAUTH TOKEN"
-#    file_glob: true
-#    file: dist/*.{deb,rpm,AppImage,dmg}
-#    skip_cleanup: true
-#    on:
-#      tags: true
-#      branch: master

+ 0 - 31
.travis/linux_after_success.sh

@@ -1,31 +0,0 @@
-#!/bin/bash --
-
-set -e
-
-DIST_PATH=dist
-
-if [[ "${EXTEN}" == "other" ]]; then
-	cp "${BUILD_DST_PATH}/flameshot" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_${ARCH}"
-	cd "${ROOT_PATH}/.travis/services"
-	TEMP_DOWNLOAD_URL=$(travis_retry bash \
-	"${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \
-	flameshot_"${VERSION}_${ARCH}")
-else
-	case "${OS}" in
-		"ubuntu"|"debian")
-		    cp "${DIST_PATH}/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}"
-			cd "${ROOT_PATH}/.travis/services"
-			TEMP_DOWNLOAD_URL=$(travis_retry bash \
-				"${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \
-				"flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}")
-			;;
-		"fedora")
-			cp "${DIST_PATH}/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}"
-			cd "${ROOT_PATH}/.travis/services"
-			TEMP_DOWNLOAD_URL=$(travis_retry bash \
-				"${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \
-				"flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}")
-			;;
-	esac
-fi
-

+ 0 - 7
.travis/linux_before_install.sh

@@ -1,7 +0,0 @@
-#!/bin/bash --
-
-set -e
-
-if [[ "${EXTEN}" == "other" ]]; then
-	travis_retry sudo apt update
-fi

+ 0 - 15
.travis/linux_install.sh

@@ -1,15 +0,0 @@
-#!/bin/bash --
-
-set -e
-
-if [[ "${EXTEN}" == "other" ]]; then
-	# Compile-time
-	travis_retry sudo apt install -y gcc g++ build-essential qt5-default qt5-qmake qttools5-dev-tools
-	# Run-time
-	travis_retry sudo apt install -y libqt5dbus5 libqt5network5 libqt5core5a libqt5widgets5 libqt5gui5 libqt5svg5-dev
-	# Optional
-	travis_retry sudo apt install -y openssl ca-certificates
-	# Install fcitx-frontend-qt5
-	travis_retry sudo apt install -y fcitx-frontend-qt5
-
-fi

+ 0 - 42
.travis/linux_script.sh

@@ -1,42 +0,0 @@
-#!/bin/bash --
-
-set -e
-
-DIST_PATH=dist
-
-if [[ ! -d "${DIST_PATH}" ]]; then
-	mkdir "${DIST_PATH}"
-fi
-
-if [[ "${EXTEN}" == "other" ]]; then
-	project_dir="$(pwd)"
-	BUILD_DST_PATH=build-test
-
-	qmake --version
-	mkdir "${BUILD_DST_PATH}"
-	qmake -makefile DESTDIR="${BUILD_DST_PATH}" "${project_dir}"/flameshot.pro
-	# Building flameshot
-	make -j$(nproc)
-	# Running flameshot tests
-	make check -j$(nproc)
-	ls -alhR
-
-else
-	travis_retry git clone https://github.com/flameshotapp/packpack.git
-	travis_retry packpack/packpack
-	pwd && ls
-
-	case "${OS}" in
-		"ubuntu"|"debian")
-			# copy deb to dist path for distribution
-			cp \
-				build/flameshot_*_*.deb \
-				"${DIST_PATH}"/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}
-			;;
-		"fedora")
-			cp \
-				build/flameshot-${VERSION}-${RELEASE}.*.${ARCH}.rpm \
-				"${DIST_PATH}"/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}
-			;;
-	esac
-fi

+ 0 - 55
.travis/osx_script.sh

@@ -1,55 +0,0 @@
-#!/bin/bash --
-
-set -e
-
-project_dir="$(pwd)"
-
-brew update > /dev/null
-brew install qt
-QTDIR=/usr/local/opt/qt
-PATH="${QTDIR}"/bin:"${PATH}"
-LDFLAGS=-L"${QTDIR}"/lib
-CPPFLAGS=-I"${QTDIR}"/include
-
-# Build your app
-cd "${project_dir}"
-mkdir dist
-mkdir build
-cd build
-qmake -version
-qmake CONFIG-=debug CONFIG+=release CONFIG+=packaging ../flameshot.pro
-make -j$(nproc)
-
-git clone https://github.com/aurelien-rainone/macdeployqtfix.git
-pwd
-ls
-
-ls /Users/travis/build/ZetaoYang/flameshot
-
-# Package DMG from build/flamshot.app directory
-"${QTDIR}"/bin/macdeployqt flameshot.app
-python \
-	"${project_dir}"/build/macdeployqtfix/macdeployqtfix.py \
-	flameshot.app/Contents/MacOS/flameshot \
-	"${QTDIR}"
-
-cd "${project_dir}"/build
-mkdir -p distrib/Flameshot
-cd distrib/Flameshot
-mv "${project_dir}"/build/flameshot.app "${project_dir}"/build/distrib/Flameshot/
-cp "${project_dir}"/LICENSE LICENSE
-cp "${project_dir}"/README.md README.md
-echo "${VERSION}" > version
-echo "${TRAVIS_COMMIT}" >> version
-
-ln -s /Applications ./Applications
-
-cd ..
-hdiutil create -srcfolder ./Flameshot -format UDBZ ./flameshot.dmg
-mv flameshot.dmg flameshot_X64_${VERSION}.dmg
-mv flameshot_X64_${VERSION}.dmg "${project_dir}"/dist/flameshot_X64_$VERSION.dmg
-TEMP_DOWNLOAD_URL=$(curl \
-	--upload-file \
-	flameshot_X64_$VERSION.dmg \
-	"https://transfer.sh/flameshot_X64_$VERSION.dmg")
-cd ..

+ 0 - 25
.travis/services/0x0.st.sh

@@ -1,25 +0,0 @@
-#!/bin/sh
-#===============================================================
-# File URLs are valid for at least 30 days and up to a year (see below).
-# Shortened URLs do not expire.
-# Maximum file size: 512.0 MiB
-# Blocked file types: application/x-dosexec, application/x-executable
-#===============================================================
-
-URL="https://0x0.st"
-
-if [ $# -eq 0 ]; then
-    echo "Usage: 0x0.st FILE\n"
-    exit 1
-fi
-
-FILE=$1
-
-if [ ! -f "$FILE" ]; then
-    echo "File ${FILE} not found"
-    exit 1
-fi
-
-RESPONSE=$(curl -# -F "file=@${FILE}" "${URL}")
-
-echo "${RESPONSE}"  # to terminal

Some files were not shown because too many files changed in this diff