Skip to content

Commit 77e05b0

Browse files
prepare for releases
1 parent 0f6e266 commit 77e05b0

File tree

9 files changed

+52
-104
lines changed

9 files changed

+52
-104
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
custom:
2-
- paypal.me/linusdierheimer
1+
custom: paypal.me/linusdierheimer

.github/workflows/build-deb-package.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
BUILD_TYPE: Release
1111

1212
jobs:
13-
default:
13+
check:
1414
name: Build, Run and Analyze fastfetch
1515
runs-on: ubuntu-latest
1616
permissions:
@@ -50,3 +50,18 @@ jobs:
5050

5151
- name: Perform CodeQL Analysis
5252
uses: github/codeql-action/analyze@v1
53+
54+
- name: Build deb package
55+
run: sh packaging/deb/create.sh .
56+
57+
- name: Upload binary
58+
uses: actions/upload-artifact@v2
59+
with:
60+
name: fastfetch
61+
path: ./fastfetch
62+
63+
- name: Upload deb package
64+
uses: actions/upload-artifact@v2
65+
with:
66+
name: fastfetch.deb
67+
path: ./packaging/deb/fastfetch.deb

CMakeLists.txt

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
cmake_minimum_required(VERSION 3.1.0) # Threads::Threads
22

3-
project(fastfetch LANGUAGES C)
3+
project(fastfetch
4+
VERSION 0.1.0
5+
LANGUAGES C
6+
)
47

58
include(GNUInstallDirs)
69

@@ -25,26 +28,6 @@ endif()
2528
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wconversion")
2629
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Wl,-O3")
2730

28-
set(PROJECT_VERSION "r0.0" CACHE STRING "Full version")
29-
set(PROJECT_VERSION_MAJOR "0" CACHE STRING "Major version")
30-
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
31-
execute_process(
32-
COMMAND git rev-list --count HEAD
33-
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
34-
OUTPUT_VARIABLE GIT_REV_LIST
35-
OUTPUT_STRIP_TRAILING_WHITESPACE
36-
)
37-
execute_process(
38-
COMMAND git rev-parse --short HEAD
39-
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
40-
OUTPUT_VARIABLE GIT_REV_PARSE
41-
OUTPUT_STRIP_TRAILING_WHITESPACE
42-
)
43-
44-
set(PROJECT_VERSION "r${GIT_REV_LIST}.${GIT_REV_PARSE}")
45-
set(PROJECT_VERSION_MAJOR "${GIT_REV_LIST}")
46-
endif()
47-
4831
function(fastfetch_load_text FILENAME OUTVAR)
4932
file(READ "${FILENAME}" TEMP)
5033
string(REPLACE "\n" "\\n" TEMP "${TEMP}")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ If pkg-config fails to find the headers for a library listed in [dependencies](#
8686
* [AUR](https://aur.archlinux.org/packages/fastfetch-git/): Packaged by me. Will install the fastfetch binary, bash completion and the presets. Git version
8787
* [Manjaro Repositories](https://gitlab.manjaro.org/packages/community/fastfetch): Packaged by a manjaro maintainer. Usually a bit outdated.
8888
* [Gentoo (Guru)](https://github.com/gentoo/guru/tree/master/app-misc/fastfetch): Packed by some other guy. May be out of date some times.
89-
* DEB: You need to build deb packages yourself. Run [`packaging/deb/create-deb-pkg.sh`](packaging/deb/create-deb-pkg.sh) for that.
89+
* DEB: Run [`packaging/deb/create.sh`](packaging/deb/create.sh) from the root directory. You can give a custom build directory as an argument.
9090
* Manually:
9191
* Build: Follow the [build instructions](#building).
9292
* Install: `sudo cmake --install build --prefix /usr/local`

packaging/deb/control-template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Version: <VERSION>
33
Section: utils
44
Priority: extra
55
Architecture: amd64
6-
Maintainer: peter@bohner.me
6+
Maintainer: Linus@Dierheimer.de
77
Homepage: https://github.com/LinusDierheimer/fastfetch
88
Installed-Size: 410K
99
Description: A fast alternative to neofetch

packaging/deb/create-deb-pkg.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

packaging/deb/create.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
# This script is intended to be run from the root of the repository.
4+
# If you don't want to use build/ as build directoy, or already build the elsewere, you can give the build directoy as argument.
5+
6+
BUILD_DIR="${1:-build}"
7+
ROOT_DIR="${2:-.}"
8+
PACKAGE_DIR="${BUILD_DIR}/packaging/deb/fastfetch"
9+
10+
# Create missing files
11+
mkdir -p "${BUILD_DIR}" || exit 1
12+
13+
if [ ! -f "${BUILD_DIR}/cmake_install.cmake" ]; then
14+
cmake -S "${ROOT_DIR}" -B "${BUILD_DIR}" || exit 2
15+
rm -f "${BUILD_DIR}/fastfetch" || exit 3 # Always rebuild the project if we reconfigured it
16+
fi
17+
18+
if [ ! -f "${BUILD_DIR}/fastfetch" ]; then
19+
cmake --build "${BUILD_DIR}" || exit 4
20+
fi
21+
22+
# Populate the files
23+
cmake --install "${BUILD_DIR}" --prefix "${PACKAGE_DIR}/usr" || exit 5
24+
mkdir -p "${PACKAGE_DIR}/DEBIAN" || exit 6
25+
sed "s/<VERSION>/$("${BUILD_DIR}/fastfetch" --version)/g" "${ROOT_DIR}/packaging/deb/control-template" > "${PACKAGE_DIR}/DEBIAN/control" || exit 7
26+
27+
# Create the package
28+
dpkg-deb --build "${PACKAGE_DIR}" || exit 8

src/fastfetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
613613
}
614614
else if(strcasecmp(key, "-v") == 0 || strcasecmp(key, "--version") == 0)
615615
{
616-
puts(FASTFETCH_PROJECT_NAME" "FASTFETCH_PROJECT_VERSION);
616+
puts(FASTFETCH_PROJECT_VERSION);
617617
exit(0);
618618
}
619619
else if(strcasecmp(key, "--list-logos") == 0)

0 commit comments

Comments
 (0)