Skip to content

Commit 27c819c

Browse files
TravisEz13daxian-dbw
authored andcommitted
Add build support for OpenSUSE 42.1 (PowerShell#3389)
1 parent 0f099ee commit 27c819c

10 files changed

Lines changed: 54 additions & 13 deletions

File tree

build.psm1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ if ($IsLinux) {
4040
$IsFedora = $LinuxInfo.ID -match 'fedora' -and $LinuxInfo.VERSION_ID -ge 24
4141
$IsOpenSUSE = $LinuxInfo.ID -match 'opensuse'
4242
$IsOpenSUSE13 = $IsOpenSUSE -and $LinuxInfo.VERSION_ID -match '13'
43+
${IsOpenSUSE42.1} = $IsOpenSUSE -and $LinuxInfo.VERSION_ID -match '42.1'
4344
$IsRedHatFamily = $IsCentOS -or $IsFedora -or $IsOpenSUSE
4445

4546
# Workaround for temporary LD_LIBRARY_PATH hack for Fedora 24
@@ -99,7 +100,8 @@ function Start-PSBuild {
99100
"win10-x64",
100101
"osx.10.11-x64",
101102
"osx.10.12-x64",
102-
"opensuse.13.2-x64")]
103+
"opensuse.13.2-x64",
104+
"opensuse.42.1-x64")]
103105
[Parameter(ParameterSetName='CoreCLR')]
104106
[string]$Runtime,
105107

@@ -473,7 +475,8 @@ function New-PSOptions {
473475
"win10-x64",
474476
"osx.10.11-x64",
475477
"osx.10.12-x64",
476-
"opensuse.13.2-x64")]
478+
"opensuse.13.2-x64",
479+
"opensuse.42.1-x64")]
477480
[string]$Runtime,
478481

479482
[switch]$Publish,
@@ -1668,14 +1671,14 @@ esac
16681671
# We currently only support:
16691672
# CentOS 7
16701673
# Fedora 24+
1671-
# OpenSUSE 13.2
1674+
# OpenSUSE 42.1 (13.2 might build but is EOL)
16721675
# Also SEE: https://fedoraproject.org/wiki/Packaging:DistTag
16731676
if ($IsCentOS) {
16741677
$rpm_dist = "el7.centos"
16751678
} elseif ($IsFedora) {
16761679
$version_id = $LinuxInfo.VERSION_ID
16771680
$rpm_dist = "fedora.$version_id"
1678-
} elseif ($IsOpenSUSE13) {
1681+
} elseif ($IsOpenSUSE) {
16791682
$version_id = $LinuxInfo.VERSION_ID
16801683
$rpm_dist = "suse.$version_id"
16811684
}
@@ -2695,7 +2698,8 @@ function Start-CrossGen {
26952698
"win10-x64",
26962699
"osx.10.11-x64",
26972700
"osx.10.12-x64",
2698-
"opensuse.13.2-x64")]
2701+
"opensuse.13.2-x64",
2702+
"opensuse.42.1-x64")]
26992703
[string]
27002704
$Runtime
27012705
)
@@ -2761,6 +2765,8 @@ function Start-CrossGen {
27612765
"fedora.24-x64"
27622766
} elseif ($IsOpenSUSE13) {
27632767
"opensuse.13.2-x64"
2768+
} elseif (${IsOpenSUSE42.1}) {
2769+
"opensuse.42.1-x64"
27642770
}
27652771
} elseif ($IsOSX) {
27662772
"osx.10.10-x64"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Docker image file that describes an OpenSUSE 42.1 (AKA leap 42.1) image with PowerShell installed from PowerShell Release
2+
FROM opensuse:42.1
3+
LABEL maintainer Travis Plunk <travis.plunk@microsoft.com>
4+
5+
ARG POWERSHELL_VERSION=6.0.0_alpha.17
6+
ARG POWERSHELL_RELEASE=v6.0.0-alpha.17
7+
ARG FORK=PowerShell
8+
ARG POWERSHELL_PACKAGE=powershell-$POWERSHELL_VERSION-1.suse.42.1.x86_64.rpm
9+
10+
# Update, Install packages to generate localedef and CURL which is used by RPM
11+
# add the Microsoft key as trusted to install packgages using RPM
12+
# Install PowerShell then clean up
13+
RUN zypper --non-interactive update --skip-interactive \
14+
&& zypper --non-interactive install \
15+
glibc-locale \
16+
glibc-i18ndata \
17+
curl \
18+
&& rpm --import https://packages.microsoft.com/keys/microsoft.asc \
19+
&& zypper --non-interactive install https://github.com/$FORK/PowerShell/releases/download/$POWERSHELL_RELEASE/$POWERSHELL_PACKAGE \
20+
&& zypper --non-interactive clean --all
21+
22+
# Setup the locale
23+
ENV LANG en_US.UTF-8
24+
ENV LC_ALL $LANG
25+
RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG
26+
27+
ENTRYPOINT [ "powershell" ]

src/ResGen/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"win10-x64": { },
3030
"osx.10.11-x64": { },
3131
"osx.10.12-x64": { },
32-
"opensuse.13.2-x64": {}
32+
"opensuse.13.2-x64": {},
33+
"opensuse.42.1-x64": {}
3334
}
3435
}

src/TypeCatalogGen/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"win10-x64": { },
5555
"osx.10.11-x64": { },
5656
"osx.10.12-x64": { },
57-
"opensuse.13.2-x64": {}
57+
"opensuse.13.2-x64": {},
58+
"opensuse.42.1-x64": {}
5859
}
5960
}

src/TypeCatalogParser/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"win10-x64": { },
5252
"osx.10.11-x64": { },
5353
"osx.10.12-x64": { },
54-
"opensuse.13.2-x64": {}
54+
"opensuse.13.2-x64": {},
55+
"opensuse.42.1-x64": {}
5556
}
5657
}

src/powershell-unix/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"fedora.24-x64": { },
106106
"osx.10.11-x64": { },
107107
"osx.10.12-x64": { },
108-
"opensuse.13.2-x64": {}
108+
"opensuse.13.2-x64": {},
109+
"opensuse.42.1-x64": {}
109110
}
110111
}

test/PSReadLine/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"win10-x64": { },
3232
"osx.10.11-x64": { },
3333
"osx.10.12-x64": { },
34-
"opensuse.13.2-x64": {}
34+
"opensuse.13.2-x64": {},
35+
"opensuse.42.1-x64": {}
3536
}
3637
}

test/csharp/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"win10-x64": { },
3838
"osx.10.11-x64": { },
3939
"osx.10.12-x64": { },
40-
"opensuse.13.2-x64": {}
40+
"opensuse.13.2-x64": {},
41+
"opensuse.42.1-x64": {}
4142
}
4243
}

test/tools/CreateChildProcess/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"win10-x64": { },
2828
"osx.10.11-x64": { },
2929
"osx.10.12-x64": { },
30-
"opensuse.13.2-x64": {}
30+
"opensuse.13.2-x64": {},
31+
"opensuse.42.1-x64": {}
3132
}
3233
}

test/tools/EchoArgs/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"win10-x64": { },
2828
"osx.10.11-x64": { },
2929
"osx.10.12-x64": { },
30-
"opensuse.13.2-x64": {}
30+
"opensuse.13.2-x64": {},
31+
"opensuse.42.1-x64": {}
3132
}
3233
}

0 commit comments

Comments
 (0)