Skip to content
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

GPL2+ LICENSE change and MAINTAINER change #710

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
# a pull request then we can checkout the head.
fetch-depth: 2

- name: Install dependencies
run: sudo apt-get install cmake libffi-dev libgtk2.0-dev liblzma-dev libselinux1-dev libsoup2.4-dev pciutils libjson-glib-dev
- name: Install system dependencies
run: sudo apt install libjson-glib-dev zlib1g-dev libsoup2.4-dev libgtk-3-dev libglib2.0-dev gettext

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
name: Build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: sudo apt install libjson-glib-dev zlib1g-dev libsoup2.4-dev libgtk-3-dev libglib2.0-dev gettext

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build
#--target hardinfo

#--config ${{env.BUILD_TYPE}}

#- name: Test
# working-directory: ${{github.workspace}}/build
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{env.BUILD_TYPE}}


167 changes: 143 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
project(HardInfo)
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
cmake_minimum_required(VERSION 2.8.12)
cmake_policy(VERSION 2.8.12)
project(hardinfo)

set(HARDINFO_VERSION "1.0.1")

option(HARDINFO_GTK3 "Build for GTK3 (0/off for GTK2)" 1)
option(HARDINFO_LIBSOUP3 "Build for libsoup-3.0(EXPERIMENTAL) (0/off for libsoup-2.4)" 0)

set(HARDINFO_VERSION "0.6-alpha")
option(HARDINFO_GTK3 "Attempt to build for GTK3 (0/off for GTK2)" 0)
set(OVRARCH "" CACHE STRING "Override HARDINFO_ARCH value")
set(OVRCPUINFO "" CACHE STRING "Specify a different file for /proc/cpuinfo")
set(OVRDTRROOT "" CACHE STRING "Specify a different path for /proc/device-tree")
SET( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
set(OVRPACKAGE_FILENAME "" CACHE STRING "Override package filename")

SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(GNUInstallDirs)

if(${CMAKE_BUILD_TYPE} MATCHES [Dd]ebug)
Expand Down Expand Up @@ -51,8 +56,6 @@ elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "sh[3-5]")
set(HARDINFO_ARCH "sh")
elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "(riscv|riscv32|riscv64)")
set(HARDINFO_ARCH "riscv")
elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "e2k")
set(HARDINFO_ARCH "e2k")
else()
message(FATAL_ERROR "Unsupported architecture: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
endif()
Expand All @@ -74,25 +77,90 @@ message(STATUS "LOCALEDIR = ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LOCALEDIR}")
message(STATUS "Building HardInfo for architecture: ${HARDINFO_OS}-${HARDINFO_ARCH}")

add_definitions("-std=gnu89")
add_definitions("-Wno-deprecated-declarations")
#add_definitions("-Wno-deprecated-declarations")
#add_definitions("-Wextra")
#add_definitions("-Wno-missing-field-initializers")
add_definitions("-Wformat")
add_definitions("-Wformat-security")

set(PACKAGE_LIBSOUP2_MINVERSION 2.42)
#Actually needed for save settings, steal_pointer - FIXME
set(PACKAGE_LIBGLIB2_MINVERSION 2.44)
#set(PACKAGE_LIBGLIB2_MINVERSION 2.28)

###################################DISTRO CHANGES###############################
#Please add all distro relates stuff here
SET(PACKAGE_MANPAGES 1)
set(RPM 0)
file(STRINGS /etc/os-release distro REGEX "^NAME=")
string(REGEX REPLACE "NAME=" "" distro "${distro}")
string(REGEX REPLACE "\"" "" distro "${distro}")
file(STRINGS /etc/os-release disversion REGEX "^VERSION_ID=")
string(REGEX REPLACE "VERSION_ID=" "" disversion "${disversion}")
string(REGEX REPLACE "\"" "" disversion "${disversion}")
string(REPLACE "/" "_" CPACK_SYSTEM_NAME ${distro}-${disversion}.${CMAKE_HOST_SYSTEM_PROCESSOR})
string(REPLACE " " "_" CPACK_SYSTEM_NAME ${CPACK_SYSTEM_NAME})
message("-- Found Package Target ${CPACK_SYSTEM_NAME}")
if(OVRPACKAGE_FILENAME)
set(CPACK_SYSTEM_NAME ${OVRPACKAGE_FILENAME})
endif()

#flavour output
set(HARDINFO_OS ${distro})

# currently all RPM flavours uses libsoup-2.4
if(${distro} MATCHES "Alma*" OR ${distro} MATCHES "Rocky*" OR ${distro} MATCHES "Fedora*" OR ${distro} MATCHES "Red*" OR ${distro} MATCHES "CentOS*" OR ${distro} MATCHES "Oracle*")
set(RPM 1)
set(HARDINFO_LIBSOUP3 0)
endif()

#oracle 6
if(${distro}${disversion} MATCHES "Oracle6*")
set(HARDINFO_LIBSOUP3 0)
set(HARDINFO_GTK3 0)
#old deprecated version - but ok
set(PACKAGE_LIBSOUP2_MINVERSION 2.34.3)
#save settings disabled, steal_pointer disabled
set(PACKAGE_LIBGLIB2_MINVERSION 2.28.8)
message("-- Low GLIB2 version 2.28.0 - FIXME")
endif()

#ubuntu 20.04
if(${distro}${disversion} MATCHES "Ubuntu20.04")
set(HARDINFO_LIBSOUP3 0)
endif()

#Debian 11
if(${distro}${disversion} MATCHES "Debian GNU/Linux11")
set(HARDINFO_LIBSOUP3 0)
endif()

#Fedora 39 - bug with man pages - probably needs upgrade..
if(${distro}${disversion} MATCHES "Fedora Linux39")
set(PACKAGE_MANPAGES 0)
endif()

################################################################################
add_subdirectory(po)


include(FindPkgConfig)
if (HARDINFO_GTK3)
message(STATUS "Building for GTK3 (experimental!)")
pkg_check_modules(GTK REQUIRED gtk+-3.0>=3.0 cairo>=1.0 cairo-png>=1.0 glib-2.0>=2.10 gthread-2.0>=2.10 gmodule-export-2.0>=2.10)
add_definitions(-DGTK_DISABLE_SINGLE_INCLUDES)
message(STATUS "Building for GTK3")
pkg_check_modules(GTK REQUIRED gtk+-3.0>=3.0 cairo>=1.0 cairo-png>=1.0 gthread-2.0>=2.10 gmodule-export-2.0>=2.10)
add_definitions(-DGTK_DISABLE_SINGLE_INCLUDES)
else()
message(STATUS "Building for GTK2")
pkg_check_modules(GTK REQUIRED gtk+-2.0>=2.10 glib-2.0>=2.10 gthread-2.0>=2.10 gmodule-export-2.0>=2.10)
message(STATUS "Building for GTK2")
pkg_check_modules(GTK REQUIRED gtk+-2.0>=2.10 gthread-2.0>=2.10 gmodule-export-2.0>=2.10)
endif()

pkg_check_modules(LIBSOUP libsoup-2.4>=2.42)
pkg_check_modules(JSON_GLIB REQUIRED json-glib-1.0)

if (HARDINFO_LIBSOUP3)
pkg_check_modules(LIBSOUP REQUIRED libsoup-3.0>=3.00)
else()
pkg_check_modules(LIBSOUP REQUIRED libsoup-2.4>=${PACKAGE_LIBSOUP2_MINVERSION})
endif()
pkg_check_modules(GLIB2 REQUIRED glib-2.0>=${PACKAGE_LIBGLIB2_MINVERSION})
pkg_check_modules(JSON_GLIB REQUIRED json-glib-1.0>=0.14.2)
pkg_check_modules(X11 REQUIRED x11)

include(FindZLIB REQUIRED)
Expand Down Expand Up @@ -136,11 +204,11 @@ set(HARDINFO_RESOURCES
"data/pci.ids.min"
"data/kernel-module-icons.json"
)

if(${PACKAGE_MANPAGES})
set(HARDINFO_MANPAGES
"hardinfo.1"
)

endif()
set(MODULE_computer_SOURCES
modules/computer.c
modules/computer/alsa.c
Expand Down Expand Up @@ -391,11 +459,11 @@ install(DIRECTORY pixmaps
PATTERN "*.{png,svg}"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
install(DIRECTORY doc
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/hardinfo
PATTERN "*.{hlp,png}"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
#install(DIRECTORY doc
# DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/hardinfo
# PATTERN "*.{hlp,png}"
# PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
#)
install(FILES ${HARDINFO_MANPAGES}
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
Expand All @@ -404,3 +472,54 @@ install(FILES pixmaps/hardinfo.png
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)

########################PACKAGE BUILDING FOR DISTROS###########################
#Please update here for building packages

SET(CPACK_PACKAGE_VERSION ${HARDINFO_VERSION})
SET(CPACK_PACKAGE_HOMEPAGE_URL "https://hardinfo.bigbear.dk")
if(${RPM})
SET(CPACK_GENERATOR "RPM")
else()
SET(CPACK_GENERATOR "DEB")
endif()

#RPM
SET(CPACK_RPM_PACKAGE_MAINTAINER "hwspeedy <[email protected]>")
SET(CPACK_RPM_PACKAGE_DESCRIPTION "HardInfo is a small application that displays information about your hardware and operating system. It has online benchmarking to check your machine performance against other machines.")
SET(CPACK_RPM_PACKAGE_RECOMMENDS "sysbench, udisks2, mesa-utils, lsscsi, lm-sensors, xdg-utils")
SET(CPACK_RPM_PACKAGE_LICENSE "GPL2+")
SET(CPACK_RPM_PACKAGE_HOMEPAGE "https://github.com/hwspeedy/hardinfo")
if(HARDINFO_LIBSOUP3)
SET(PACKAGE_LS "libsoup (>=3.0)")
else()
SET(PACKAGE_LS "libsoup (>=${PACKAGE_LIBSOUP2_MINVERSION})")
endif()
if(HARDINFO_GTK3)
SET(PACKAGE_GTK "libgtk-3-0 (>=3.0)")
else()
SET(PACKAGE_GTK "libgtk-2-0 (>=2.20)")
endif()
SET(CPACK_RPM_PACKAGE_DEPENDS "libjson-glib-1.0-0, zlib, ${PACKAGE_LS}, ${PACKAGE_GTK}, libglib2.0-0 (>=2.10)")

#DEB
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "hwspeedy <[email protected]>")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "HardInfo is a small application that displays information about your hardware and operating system. It has online benchmarking to check your machine performance against other machines.")
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "sysbench, udisks2, mesa-utils, lsscsi, lm-sensors, xdg-utils")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/hwspeedy/hardinfo")
if(HARDINFO_LIBSOUP3)
SET(PACKAGE_LS "libsoup-3.0.0 (>=3.0)")
else()
SET(PACKAGE_LS "libsoup2.4-1 (>=${PACKAGE_LIBSOUP2_MINVERSION})")
if(${distro}${disversion} MATCHES "Debian GNU/Linux11")
SET(PACKAGE_LS "libsoup2.4-0 (>=2.42)")
endif()
endif()
if(HARDINFO_GTK3)
SET(PACKAGE_GTK "libgtk-3-0 (>=3.0)")
else()
SET(PACKAGE_GTK "libgtk-2-0 (>=2.20)")
endif()
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libjson-glib-1.0-0, zlib1g, ${PACKAGE_LS}, ${PACKAGE_GTK}")

INCLUDE(CPack)
5 changes: 3 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Valid-License-Identifier: GPL-2.0+

GNU General Public License v2.0 or later

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hwspeedy this PR already covers the issue of uber-graph #702 ? as i can see, GTK3 does use it! based on CMAkelist file depends

NOTE what happened with the "forum like" place? where we discuss things?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mckaygerhard - I am trying to keep the community together.

  • so my repo was scratched to make this commit as small as possible. This PR is all that is needed to move forward - GTK3 with uber-graph with correct licensing and a maintainer change, so that we all can help on this project.

As soon as @lpereira has transferred the repo, I will recreate discussion for entire project.

I have around 20 commits lined up for you and others to provide feedback on. And we have a discussion about dependencies for packaging. It will be fun - we will get hardinfo released.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok got it.. lest wait until responds, lest have a bit of patiente

Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Expand Down
Loading