-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from nevernever69/dev
Added support for Arch
- Loading branch information
Showing
9 changed files
with
89 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
project(RunScript) | ||
|
||
if(UNIX AND NOT APPLE) | ||
file(READ "/etc/os-release" OS_RELEASE) | ||
|
||
string(REGEX MATCH "ID=([A-Za-z]*)" LINUX_ID_MATCH "${OS_RELEASE}") | ||
set(LINUX_ID "${CMAKE_MATCH_1}") | ||
|
||
if(NOT LINUX_ID) | ||
string(REGEX MATCH "ID_LIKE=([A-Za-z]*)" LINUX_ID_LIKE_MATCH "${OS_RELEASE}") | ||
set(LINUX_ID "${CMAKE_MATCH_1}") | ||
endif() | ||
|
||
if(LINUX_ID STREQUAL "") | ||
message(WARNING "Could not identify Linux distribution. Adapting as much as possible.") | ||
set(DISTRO "Unknown Linux Distribution") | ||
else() | ||
if(LINUX_ID STREQUAL "arch") | ||
message(STATUS "Detected Arch Linux") | ||
set(DISTRO "Arch Linux") | ||
add_custom_target(run_script | ||
COMMAND sudo pacman -S --needed base-devel curl wget file openssl gtk3 patchelf libappindicator-gtk3 librsvg -y webkit2gtk | ||
COMMENT "Running script on Arch Linux" | ||
) | ||
elseif(LINUX_ID STREQUAL "debian") | ||
message(STATUS "Detected Debian Linux") | ||
set(DISTRO "Debian Linux") | ||
add_custom_target(run_script | ||
COMMAND sudo apt-get install libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev patchelf libappindicator3-dev librsvg2-dev -y | ||
COMMENT "Running script on Debian Linux" | ||
) | ||
|
||
else() | ||
message(STATUS "Detected ${LINUX_ID}-like Linux distribution") | ||
set(DISTRO "${LINUX_ID}-like Linux") | ||
add_custom_target(run_script | ||
COMMAND sudo apt-get install libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev patchelf libappindicator3-dev librsvg2-dev -y | ||
COMMENT "Running script on Debian Linux" | ||
) | ||
|
||
endif() | ||
endif() | ||
|
||
|
||
else() | ||
message(FATAL_ERROR "This CMake script is designed for Linux systems only.") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
all: build run | ||
build: | ||
cmake -Bbuild | ||
cmake --build build/ | ||
|
||
|
||
clean: | ||
rm -rf build/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {createContext, useState} from 'react'; | ||
export const DistroContext = createContext(null); | ||
export const DistroProvider = (props) => { | ||
const [distro, setDistro] = useState('Ubuntu'); | ||
return( | ||
<DistroContext.Provider value={{distro, setDistro}}> | ||
{props.children} | ||
</DistroContext.Provider> | ||
|
||
) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters