-
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.
- Loading branch information
1 parent
bb727e0
commit fce363c
Showing
7 changed files
with
141 additions
and
10 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
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 @@ | ||
package = { ref = "cpp" } |
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,62 @@ | ||
package = { | ||
-- base info | ||
|
||
homepage = "https://github.com/d2learn/xim-pkgindex", | ||
|
||
name = "cpp", | ||
description = "C++ language toolchain", | ||
maintainers = "xim team", | ||
contributors = "https://github.com/d2learn/xim-pkgindex/graphs/contributors", | ||
|
||
-- xim pkg info | ||
type = "auto-config", | ||
status = "stable", -- dev, stable, deprecated | ||
categories = {"plang", "compiler", "c"}, | ||
|
||
xpm = { | ||
windows = { | ||
deps = {"msvc"}, | ||
["latest"] = { ref = "msvc" }, | ||
["msvc"] = {}, | ||
}, | ||
ubuntu = { | ||
deps = {"gcc"}, | ||
["latest"] = { ref = "gnu" }, | ||
["gnu"] = {}, | ||
}, | ||
debain = { ref = "ubuntu" }, | ||
}, | ||
} | ||
|
||
import("core.tool.toolchain") | ||
|
||
import("xim.base.runtime") | ||
import("xim.xuninstall") | ||
|
||
|
||
local pkginfo = runtime.get_pkginfo() | ||
|
||
function installed() | ||
if pkginfo.version == "msvc" then | ||
return toolchain.load("mingw"):check() | ||
elseif pkginfo.version == "gnu" then | ||
local output = os.iorun("gcc --version") | ||
return string.find(output, "gcc") ~= nil | ||
else | ||
return true | ||
end | ||
end | ||
|
||
function install() | ||
-- install by deps | ||
return true | ||
end | ||
|
||
function uninstall() | ||
if pkginfo.version == "msvc" then | ||
xuninstall("msvc") | ||
elseif pkginfo.version == "gnu" then | ||
xuninstall("gcc") | ||
end | ||
return true | ||
end |
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,59 @@ | ||
-- https://learn.microsoft.com/en-gb/dotnet/core/install/linux-scripted-manual | ||
-- https://learn.microsoft.com/en-us/dotnet/core/install/remove-runtime-sdk-versions?pivots=os-linux#scripted-or-manual | ||
|
||
local installer_url = "https://dot.net/v1/dotnet-install.sh" | ||
|
||
package = { | ||
name = "dotnet", | ||
description = ".NET is the free, open-source, cross-platform framework", | ||
homepage = "https://dotnet.microsoft.com/", | ||
maintainers = "Microsoft", | ||
license = "MIT", | ||
repo = "https://github.com/dotnet/sdk", | ||
docs = "https://learn.microsoft.com/dotnet", | ||
|
||
-- xim pkg info | ||
archs = {"x86_64"}, | ||
status = "stable", -- dev, stable, deprecated | ||
categories = {"dotnet"}, | ||
keywords = {"cross-platform", ".net", "dotnet"}, | ||
|
||
xpm = { | ||
debain = { | ||
["latest"] = { ref = "9.0" }, | ||
["9.0"] = { url = installer_url, sha256 = nil }, | ||
["8.0"] = { url = installer_url, sha256 = nil }, | ||
}, | ||
ubuntu = { ref = "debain" }, | ||
archlinux = { ref = "debain" }, | ||
}, | ||
} | ||
|
||
import("xim.base.utils") | ||
import("xim.base.runtime") | ||
|
||
local pkginfo = runtime.get_pkginfo() | ||
local dotnetdir = path.join(os.getenv("HOME"), ".dotnet") | ||
|
||
function installed() | ||
os.addenv("PATH", dotnetdir) | ||
return os.iorun("dotnet --version") | ||
end | ||
|
||
function install() | ||
os.exec("chmod +x " .. pkginfo.install_file) | ||
local cmd = pkginfo.install_file .. " --channel " .. pkginfo.version | ||
print("exec: " .. cmd) | ||
os.exec(cmd) | ||
return true | ||
end | ||
|
||
function config() | ||
utils.add_env_path(dotnetdir) | ||
return true | ||
end | ||
|
||
function uninstall() | ||
os.exec("rm -r " .. dotnetdir) | ||
return true | ||
end |
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